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/SBZ/TransSprite.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Trans Sprite Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Events
10
// ========================
11
12
event ObjectDraw
13
// Simply draw the current frame, no animation or anything needed
14
DrawSprite(object.propertyValue)
15
end event
16
17
18
event ObjectStartup
19
LoadSpriteSheet("SBZ/Objects.gif")
20
21
// Sprite frames
22
SpriteFrame(-28, -32, 56, 64, 268, 274)
23
SpriteFrame(-28, -32, 56, 64, 325, 274)
24
25
// Setup for every object in the stage
26
foreach (TypeName[Trans Sprite], arrayPos0, ALL_ENTITIES)
27
// Limit the property value to 1 max
28
object[arrayPos0].propertyValue &= 1
29
30
// Set the draworder to 5 (FG)
31
object[arrayPos0].drawOrder = 5
32
next
33
end event
34
35
36
// ========================
37
// Editor Events
38
// ========================
39
40
event RSDKEdit
41
if editor.returnVariable == true
42
switch editor.variableID
43
case EDIT_VAR_PROPVAL // property value
44
checkResult = object.propertyValue
45
checkResult &= 1
46
break
47
48
case 0 // type
49
checkResult = object.propertyValue
50
checkResult &= 1
51
break
52
53
end switch
54
else
55
switch editor.variableID
56
case EDIT_VAR_PROPVAL // property value
57
object.propertyValue = editor.variableValue
58
object.propertyValue &= 1
59
break
60
61
case 0 // type
62
object.propertyValue = editor.variableValue
63
object.propertyValue &= 1
64
break
65
66
end switch
67
end if
68
end event
69
70
71
event RSDKDraw
72
DrawSprite(object.propertyValue)
73
end event
74
75
76
event RSDKLoad
77
LoadSpriteSheet("SBZ/Objects.gif")
78
SpriteFrame(-28, -32, 56, 64, 268, 274)
79
SpriteFrame(-28, -32, 56, 64, 325, 274)
80
81
AddEditorVariable("frameID")
82
SetActiveVariable("frameID")
83
AddEnumVariable("Left", 0)
84
AddEnumVariable("Right", 1)
85
end event
86
87