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/Global/DustPuff.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Dust Puff 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.propertyValue : object.targetPlayer
13
14
// Player Aliases
15
private alias object.xpos : player.xpos
16
private alias object.ypos : player.ypos
17
private alias object.direction : player.direction
18
private alias object.animation : player.animation
19
private alias object.collisionBottom : player.collisionBottom
20
21
22
// ========================
23
// Events
24
// ========================
25
26
event ObjectUpdate
27
object.xpos += object.xvel
28
object.ypos += object.yvel
29
30
switch object.frame
31
case 0
32
case 1
33
case 2
34
object.animationTimer++
35
if object.animationTimer > 3
36
object.frame++
37
object.animationTimer = 0
38
end if
39
break
40
41
case 3
42
object.animationTimer++
43
if object.animationTimer > 3
44
object.type = TypeName[Blank Object]
45
end if
46
break
47
48
case 4
49
case 5
50
case 6
51
case 7
52
case 8
53
case 9
54
object.animationTimer++
55
if object.animationTimer > 1
56
object.frame++
57
object.animationTimer = 0
58
end if
59
break
60
61
case 10
62
object.animationTimer++
63
if object.animationTimer > 1
64
object.frame = 4
65
object.animationTimer = 0
66
end if
67
break
68
69
end switch
70
end event
71
72
73
event ObjectDraw
74
if object.frame > 3
75
currentPlayer = object.targetPlayer
76
object.direction = player[currentPlayer].direction
77
object.xpos = player[currentPlayer].xpos
78
object.iypos = player[currentPlayer].collisionBottom
79
object.ypos += player[currentPlayer].ypos
80
if player[currentPlayer].animation != ANI_SPINDASH
81
object.type = TypeName[Blank Object]
82
else
83
DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
84
end if
85
86
else
87
DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
88
end if
89
end event
90
91
92
event ObjectStartup
93
LoadSpriteSheet("Global/Items.gif")
94
95
// Dust frames
96
SpriteFrame(-7, -11, 13, 14, 51, 183)
97
SpriteFrame(-7, -11, 13, 14, 65, 183)
98
SpriteFrame(-6, -11, 13, 14, 79, 183)
99
SpriteFrame(-7, -11, 13, 14, 93, 183)
100
SpriteFrame(-32, -10, 32, 10, 58, 245)
101
SpriteFrame(-32, -12, 32, 12, 91, 243)
102
SpriteFrame(-32, -16, 32, 16, 124, 239)
103
SpriteFrame(-32, -18, 32, 18, 157, 237)
104
SpriteFrame(-32, -20, 32, 20, 190, 235)
105
SpriteFrame(-32, -21, 32, 21, 223, 206)
106
SpriteFrame(-32, -23, 32, 23, 223, 228)
107
end event
108
109
110
// ========================
111
// Editor Events
112
// ========================
113
114
event RSDKDraw
115
DrawSprite(0)
116
end event
117
118
119
event RSDKLoad
120
LoadSpriteSheet("Global/Items.gif")
121
SpriteFrame(-7, -11, 13, 14, 51, 183)
122
123
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
124
end event
125
126