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/SLZ/Cannon.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Cannon 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 Cannon_DebugDraw
13
reserve function Cannon_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function Cannon_DebugDraw
21
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
22
end function
23
24
25
private function Cannon_DebugSpawn
26
CreateTempObject(TypeName[Cannon], 0, object.xpos, object.ypos)
27
28
object[tempObjectPos].direction = object.direction
29
object[tempObjectPos].drawOrder = 4
30
end function
31
32
33
// ========================
34
// Events
35
// ========================
36
37
event ObjectDraw
38
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
39
end event
40
41
42
event ObjectStartup
43
LoadSpriteSheet("SLZ/Objects.gif")
44
45
// Cannon frame
46
SpriteFrame(-8, -16, 16, 32, 67, 59)
47
48
foreach (TypeName[Cannon], arrayPos0, ALL_ENTITIES)
49
object[arrayPos0].drawOrder = 4
50
next
51
52
// Add Cannons to the debug object list
53
SetTableValue(TypeName[Cannon], DebugMode_ObjCount, DebugMode_TypesTable)
54
SetTableValue(Cannon_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
55
SetTableValue(Cannon_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
56
DebugMode_ObjCount++
57
end event
58
59
60
// ========================
61
// Editor Events
62
// ========================
63
64
event RSDKDraw
65
// direction is set from editor
66
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
67
end event
68
69
70
event RSDKLoad
71
LoadSpriteSheet("SLZ/Objects.gif")
72
SpriteFrame(-8, -16, 16, 32, 67, 59)
73
74
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
75
end event
76
77