Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 1/Scripts/GHZ/Rock.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Rock Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Function Declarations
10
// ========================
11
12
reserve function Rock_DebugDraw
13
reserve function Rock_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function Rock_DebugDraw
21
DrawSprite(0)
22
end function
23
24
25
private function Rock_DebugSpawn
26
CreateTempObject(TypeName[Rock], 0, object.xpos, object.ypos)
27
end function
28
29
30
// ========================
31
// Events
32
// ========================
33
34
event ObjectUpdate
35
// Rocks don't do much, just check interaction with players
36
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
37
BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
38
next
39
end event
40
41
42
event ObjectDraw
43
DrawSprite(0)
44
end event
45
46
47
event ObjectStartup
48
LoadSpriteSheet("GHZ/Objects.gif")
49
SpriteFrame(-24, -16, 48, 32, 1, 18)
50
51
SetTableValue(TypeName[Rock], DebugMode_ObjCount, DebugMode_TypesTable)
52
SetTableValue(Rock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
53
SetTableValue(Rock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
54
DebugMode_ObjCount++
55
end event
56
57
58
// ========================
59
// Editor Events
60
// ========================
61
62
event RSDKDraw
63
DrawSprite(0)
64
end event
65
66
67
event RSDKLoad
68
LoadSpriteSheet("GHZ/Objects.gif")
69
SpriteFrame(-24, -16, 48, 32, 1, 18)
70
71
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
72
end event
73
74