Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R1/SPlatform.txt
1319 views
1
//--------------Sonic CD Small Platform Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.OnObject
7
#alias Object.Value1 : Object.Timer
8
#alias Object.Value2 : Object.YCollisionOffset
9
10
11
sub ObjectMain
12
if Object.OnObject == true
13
if Object.Timer < 16
14
Object.Timer++
15
16
TempValue0 = Object.Timer
17
TempValue0 &= 3
18
19
if TempValue0 == 3
20
Object.YCollisionOffset = 0x10000
21
else
22
Object.YCollisionOffset = 0
23
end if
24
else
25
Object.YCollisionOffset = 0
26
end if
27
else
28
if Object.Timer > 0
29
Object.Timer--
30
31
TempValue0 = Object.Timer
32
TempValue0 &= 3
33
34
if TempValue0 == 3
35
Object.YCollisionOffset = -0x10000
36
else
37
Object.YCollisionOffset = 0
38
end if
39
40
else
41
Object.YCollisionOffset = 0
42
end if
43
end if
44
45
Object.OnObject = false
46
end sub
47
48
49
sub ObjectPlayerInteraction
50
PlayerObjectCollision(C_PLATFORM, -16, -9, 16, 12)
51
if CheckResult == true
52
Object.OnObject = true
53
Player.YPos += Object.YCollisionOffset
54
end if
55
end sub
56
57
58
sub ObjectDraw
59
Object.YPos += Object.YCollisionOffset
60
61
DrawSprite(0)
62
end sub
63
64
65
sub ObjectStartup
66
LoadSpriteSheet("R1/Objects.gif")
67
68
SpriteFrame(-16, -16, 32, 32, 190, 101) // #0 - Small Platform
69
end sub
70
71
72
// ========================
73
// Editor Subs
74
// ========================
75
76
sub RSDKDraw
77
DrawSprite(0)
78
end sub
79
80
81
sub RSDKLoad
82
LoadSpriteSheet("R1/Objects.gif")
83
84
SpriteFrame(-16, -16, 32, 32, 190, 101) // #0 - Small Platform
85
86
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
87
end sub
88
89