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/LZ/Wheel.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Wheel Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
private alias object.value0 : object.beltDir
13
14
15
// ========================
16
// Function Declarations
17
// ========================
18
19
reserve function Wheel_DebugDraw
20
reserve function Wheel_DebugSpawn
21
22
23
// ========================
24
// Function Definitions
25
// ========================
26
27
private function Wheel_DebugDraw
28
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
29
end function
30
31
32
private function Wheel_DebugSpawn
33
CreateTempObject(TypeName[Wheel], 0, object.xpos, object.ypos)
34
object[tempObjectPos].drawOrder = 4
35
end function
36
37
38
// ========================
39
// Events
40
// ========================
41
42
event ObjectUpdate
43
if object.beltDir != LZSetup_beltDirection
44
object.direction ^= 1
45
object.beltDir = LZSetup_beltDirection
46
temp2 = 1
47
else
48
object.frame = oscillation
49
object.frame >>= 2
50
object.frame &= 3
51
if object.direction == 1
52
object.frame ^= 3
53
end if
54
end if
55
end event
56
57
58
event ObjectDraw
59
DrawSprite(object.frame)
60
end event
61
62
63
event ObjectStartup
64
LoadSpriteSheet("LZ/Objects.gif")
65
SpriteFrame(-16, -16, 32, 32, 223, 22)
66
SpriteFrame(-16, -16, 32, 32, 223, 55)
67
SpriteFrame(-16, -16, 32, 32, 223, 88)
68
SpriteFrame(-16, -16, 32, 32, 223, 121)
69
70
foreach (TypeName[Wheel], arrayPos0, ALL_ENTITIES)
71
object[arrayPos0].drawOrder = 4
72
next
73
74
SetTableValue(TypeName[Wheel], DebugMode_ObjCount, DebugMode_TypesTable)
75
SetTableValue(Wheel_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
76
SetTableValue(Wheel_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
77
DebugMode_ObjCount++
78
end event
79
80
81
// ========================
82
// Editor Events
83
// ========================
84
85
event RSDKDraw
86
DrawSprite(0)
87
end event
88
89
90
event RSDKLoad
91
LoadSpriteSheet("LZ/Objects.gif")
92
SpriteFrame(-16, -16, 32, 32, 223, 22)
93
94
// 127 in the scene, doesn't seem to do anything though
95
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
96
end event
97
98