Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 2/Scripts/HPZ/BridgeEnd.txt
1479 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Bridge End 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 BridgeEnd_DebugDraw
13
reserve function BridgeEnd_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function BridgeEnd_DebugDraw
21
// this object has the same sprite regardless of its direction...
22
// (leftover from EHZ's Bridge End, which itself is based off of GHZ's Bridge End)
23
temp0 = object.direction
24
temp0 &= FLIP_X
25
DrawSprite(temp0)
26
end function
27
28
29
private function BridgeEnd_DebugSpawn
30
CreateTempObject(TypeName[Bridge End], 0, object.xpos, object.ypos)
31
object[tempObjectPos].drawOrder = 4
32
33
// this object's propertyValue doesn't mean anything anyway...
34
// (leftover from EHZ's Bridge End, which itself is based off of GHZ's Bridge End)
35
object[tempObjectPos].propertyValue = object.direction
36
object[tempObjectPos].propertyValue &= FLIP_X
37
end function
38
39
40
// ========================
41
// Events
42
// ========================
43
44
event ObjectUpdate
45
object.frame = object.animationTimer
46
object.frame /= 9
47
object.animationTimer++
48
object.animationTimer %= 54
49
end event
50
51
52
event ObjectDraw
53
DrawSprite(object.frame)
54
end event
55
56
57
event ObjectStartup
58
LoadSpriteSheet("HPZ/Objects.gif")
59
SpriteFrame(-4, -12, 8, 24, 214, 206)
60
SpriteFrame(-4, -12, 8, 24, 214, 206)
61
SpriteFrame(-4, -12, 8, 24, 205, 206)
62
SpriteFrame(-4, -12, 8, 24, 196, 206)
63
SpriteFrame(-4, -12, 8, 24, 196, 206)
64
SpriteFrame(-4, -12, 8, 24, 205, 206)
65
66
arrayPos0 = 32
67
while arrayPos0 < 0x420
68
if object[arrayPos0].type == TypeName[Bridge End]
69
object[arrayPos0].drawOrder = 4
70
end if
71
72
arrayPos0++
73
loop
74
75
SetTableValue(TypeName[Bridge End], DebugMode_ObjCount, DebugMode_TypesTable)
76
SetTableValue(BridgeEnd_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
77
SetTableValue(BridgeEnd_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
78
DebugMode_ObjCount++
79
end event
80
81
82
// ========================
83
// Editor Events
84
// ========================
85
86
event RSDKDraw
87
DrawSprite(0)
88
end event
89
90
91
event RSDKLoad
92
LoadSpriteSheet("HPZ/Objects.gif")
93
SpriteFrame(-4, -12, 8, 24, 205, 206)
94
95
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
96
end event
97
98