Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R3/MovingBlock.txt
1319 views
1
//----------------Sonic CD Moving Block Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Oscillation
7
#alias Object.Value1 : Object.XOriginPos
8
9
// Spring Aliases
10
#alias Object[+1].XPos : Spring.XPos
11
12
13
sub ObjectMain
14
Object.Oscillation += 2
15
Object.Oscillation &= 511
16
Sin(Object.XPos, Object.Oscillation)
17
18
Object.XPos <<= 13
19
Object.XPos += Object.XOriginPos
20
Spring.XPos = Object.XPos
21
end sub
22
23
24
sub ObjectPlayerInteraction
25
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
26
end sub
27
28
29
sub ObjectDraw
30
DrawSprite(0)
31
end sub
32
33
34
sub ObjectStartup
35
LoadSpriteSheet("R3/Objects.gif")
36
37
SpriteFrame(-16, -16, 32, 32, 1, 1) // #0 - Moving Block
38
39
ArrayPos0 = 32
40
while ArrayPos0 < 1056
41
if Object[ArrayPos0].Type == TypeName[Moving Block]
42
Object[ArrayPos0].XOriginPos = Object[ArrayPos0].XPos
43
end if
44
ArrayPos0++
45
loop
46
end sub
47
48
49
// ========================
50
// Editor Subs
51
// ========================
52
53
sub RSDKDraw
54
DrawSprite(0)
55
end sub
56
57
58
sub RSDKLoad
59
LoadSpriteSheet("R3/Objects.gif")
60
61
SpriteFrame(-16, -16, 32, 32, 1, 1) // #0 - Moving Block
62
63
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
64
end sub
65
66