Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Mission/PlatformBlock.txt
1319 views
1
//---------------Sonic CD Platform Block Script---------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.PropertyValue : Object.BlocksNo
7
8
9
sub ObjectPlayerInteraction
10
11
if Object.BlocksNo <= 1
12
13
// This is a singular Block Platform, so only check Platform Collision as such
14
PlayerObjectCollision(C_PLATFORM,-16,-16,16,16)
15
16
else
17
18
// This Object is here in the place of several Blocks
19
20
// Base width is 32
21
TempValue0 = 32
22
23
TempValue0 *= Object.BlocksNo
24
25
// Since a left collision of -16's already gonna be tested, we can cut off 16 from the right total
26
TempValue0 -= 16
27
28
PlayerObjectCollision(C_PLATFORM, -16, -16, TempValue0, 16)
29
end if
30
31
end sub
32
33
34
sub ObjectDraw
35
36
if Object.BlocksNo <= 1
37
38
// Just draw a single Block sprite
39
DrawSprite(0)
40
41
else
42
43
// Draw all the Blocks in a loop
44
45
// TempValue1 really has no reason to exist here...
46
// It's always the same value anyway
47
48
TempValue0 = Object.XPos
49
TempValue1 = Object.YPos
50
TempValue2 = 0
51
52
while TempValue2 < Object.BlocksNo
53
DrawSpriteXY(0, TempValue0, TempValue1)
54
55
// Add 32 pixels to the current Block Position
56
TempValue0 += 0x200000
57
58
TempValue2++
59
loop
60
end if
61
62
end sub
63
64
65
sub ObjectStartup
66
67
LoadSpriteSheet("Mission/Objects.gif")
68
69
// Block Frame
70
SpriteFrame(-16, -16, 32, 32, 1, 1)
71
72
end sub
73
74
75
// ========================
76
// Editor Subs
77
// ========================
78
79
sub RSDKDraw
80
if Object.BlocksNo < 2
81
DrawSprite(0)
82
else
83
TempValue0 = Object.XPos
84
TempValue1 = 0
85
while TempValue2 < Object.BlocksNo
86
DrawSpriteXY(0, TempValue0, Object.YPos)
87
TempValue0 += 0x200000
88
TempValue1++
89
loop
90
end if
91
end sub
92
93
94
sub RSDKLoad
95
LoadSpriteSheet("Mission/Objects.gif")
96
SpriteFrame(-16, -16, 32, 32, 1, 1)
97
98
SetVariableAlias(ALIAS_VAR_PROPVAL, "BlocksNo")
99
end sub
100
101
102
103