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/RingSparkle.txt
1482 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Ring Sparkle 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.timer
13
14
// Ring Reset (Mission Object) Aliases
15
private alias object.value0 : object.timeCheckpoint
16
private alias object.value2 : object.missionTypeEX
17
18
private alias 10 : MISSIONNO_RINGCHALLENGE50
19
20
21
// ========================
22
// Events
23
// ========================
24
25
event ObjectUpdate
26
object.timer++
27
if object.timer == 6
28
object.timer = 0
29
object.frame++
30
31
if object.frame == 4
32
object.type = TypeName[Blank Object]
33
object.frame = 0
34
35
#platform: USE_ORIGINS
36
if game.playMode == BOOT_PLAYMODE_MISSION
37
if game.missionFunctionNo == MISSIONNO_RINGCHALLENGE50
38
// Turn the Object into a Ring Reset Object
39
// -> missionTypeEX is set by a foreach in Ring Reset's startup
40
object.type = object.missionTypeEX
41
42
// Now, set the time the Object was collected + 20 seconds
43
object.timeCheckpoint = stage.minutes
44
object.timeCheckpoint *= 60
45
object.timeCheckpoint += stage.seconds
46
object.timeCheckpoint += 20
47
48
object.priority = PRIORITY_ACTIVE
49
end if
50
end if
51
#endplatform
52
end if
53
end if
54
end event
55
56
57
event ObjectDraw
58
DrawSprite(object.frame)
59
end event
60
61
62
event ObjectStartup
63
LoadSpriteSheet("Global/Items.gif")
64
65
// Sparkle frames
66
SpriteFrame(-8, -8, 16, 16, 1, 202)
67
SpriteFrame(-8, -8, 16, 16, 18, 202)
68
SpriteFrame(-8, -8, 16, 16, 1, 219)
69
SpriteFrame(-8, -8, 16, 16, 18, 219)
70
end event
71
72
73
// ========================
74
// Editor Events
75
// ========================
76
77
event RSDKDraw
78
DrawSprite(0)
79
end event
80
81
82
event RSDKLoad
83
LoadSpriteSheet("Global/Items.gif")
84
SpriteFrame(-8, -8, 16, 16, 1, 202) // * Sparkle *
85
86
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
87
end event
88
89