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/VPlatform.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: V Platform 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.value1 : object.drawPos.y
13
14
// Player Aliases
15
private alias object.ypos : player.ypos
16
17
18
// ========================
19
// Function Declarations
20
// ========================
21
22
reserve function VPlatform_DebugDraw
23
reserve function VPlatform_DebugSpawn
24
25
26
// ========================
27
// Tables
28
// ========================
29
30
private function VPlatform_DebugDraw
31
DrawSprite(0)
32
end function
33
34
35
private function VPlatform_DebugSpawn
36
CreateTempObject(TypeName[V Platform], 0, object.xpos, object.ypos)
37
end function
38
39
40
// ========================
41
// Events
42
// ========================
43
44
event ObjectUpdate
45
GetTableValue(temp1, 14, StageSetup_oscillationTable)
46
temp1 <<= 8
47
temp0 = object.ypos
48
temp0 -= temp1
49
temp2 = object.drawPos.y
50
temp2 &= 0xFFFF0000
51
temp1 = temp0
52
temp1 &= 0xFFFF0000
53
temp1 -= temp2
54
temp2 = object.ypos
55
56
object.ypos = object.drawPos.y
57
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
58
BoxCollisionTest(C_PLATFORM, object.entityPos, -32, -12, 32, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
59
if checkResult == true
60
player[currentPlayer].ypos += temp1
61
end if
62
next
63
64
object.ypos = temp2
65
object.drawPos.y = temp0
66
end event
67
68
69
event ObjectDraw
70
DrawSpriteXY(0, object.xpos, object.drawPos.y)
71
end event
72
73
74
event ObjectStartup
75
LoadSpriteSheet("SBZ/Objects.gif")
76
SpriteFrame(-32, -12, 64, 24, 318, 140)
77
78
SetTableValue(TypeName[V Platform], DebugMode_ObjCount, DebugMode_TypesTable)
79
SetTableValue(VPlatform_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
80
SetTableValue(VPlatform_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
81
DebugMode_ObjCount++
82
end event
83
84
85
// ========================
86
// Editor Events
87
// ========================
88
89
event RSDKDraw
90
DrawSprite(0)
91
end event
92
93
94
event RSDKLoad
95
LoadSpriteSheet("SBZ/Objects.gif")
96
SpriteFrame(-32, -12, 64, 24, 318, 140)
97
98
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
99
end event
100
101