Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 2/Scripts/MCZ/StaticBlock.txt
1479 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Static Block 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 StaticBlock_DebugDraw
13
reserve function StaticBlock_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function StaticBlock_DebugDraw
21
DrawSprite(0)
22
end function
23
24
25
private function StaticBlock_DebugSpawn
26
CreateTempObject(TypeName[Static Block], 0, object.xpos, object.ypos)
27
end function
28
29
30
// ========================
31
// Events
32
// ========================
33
34
event ObjectUpdate
35
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
36
// Just act as a small box for the player
37
BoxCollisionTest(C_SOLID, object.entityPos, -16, -16, 16, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
38
next
39
end event
40
41
42
event ObjectDraw
43
// Interesting note - this object has its Y direction flipped one time in the Act 1 scene file,
44
// but the drawing here just uses the standard sprite drawing function rather than FX_FLIP.
45
// I wonder what's up with that...
46
47
DrawSprite(0)
48
end event
49
50
51
event ObjectStartup
52
LoadSpriteSheet("MCZ/Objects.gif")
53
54
// 0 - Wood post frame
55
SpriteFrame(-16, -16, 32, 32, 70, 0)
56
57
// Add this object to the debug item list
58
SetTableValue(TypeName[Static Block], DebugMode_ObjCount, DebugMode_TypesTable)
59
SetTableValue(StaticBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
60
SetTableValue(StaticBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
61
DebugMode_ObjCount++
62
end event
63
64
65
// ========================
66
// Editor Events
67
// ========================
68
69
event RSDKDraw
70
DrawSprite(0)
71
end event
72
73
74
event RSDKLoad
75
LoadSpriteSheet("MCZ/Objects.gif")
76
SpriteFrame(-16, -16, 32, 32, 70, 0)
77
78
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
79
end event
80
81