Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Mission/MissionAreaTR.txt
1319 views
1
//-----------Sonic CD Mission Area Top Right Script-----------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.State : Object.SetBounds
7
8
// Priority
9
#alias 1 : PRIORITY_ACTIVE
10
11
12
sub ObjectMain
13
14
// If it hasn't been done already, set the Stage's Top Right boundaries
15
if Object.SetBounds == false
16
17
// Move the X Bounds to 16 pixels to the right of this Object
18
Stage.NewXBoundary2 = Object.XPos
19
Stage.NewXBoundary2 >>= 16
20
Stage.NewXBoundary2 += 16
21
22
// And then move the Y Bounds to be right at this Object's position
23
Stage.NewYBoundary1 = Object.YPos
24
Stage.NewYBoundary1 >>= 16
25
26
// Set the flag, as the bounds have been set now
27
Object.SetBounds = true
28
end if
29
30
if Stage.State == STAGE_RUNNING
31
if Player.YPos < Object.YPos
32
Player.YVelocity = 0
33
Player.Speed = 0
34
Player.YPos = Object.YPos
35
end if
36
37
if Player.XPos > Object.XPos
38
Player.XVelocity = 0
39
Player.Speed = 0
40
Player.XPos = Object.XPos
41
end if
42
end if
43
44
end sub
45
46
47
sub ObjectStartup
48
ArrayPos0 = 32
49
while ArrayPos0 < 1056
50
if Object[ArrayPos0].Type == TypeName[MissionAreaTR]
51
Object[ArrayPos0].Priority = PRIORITY_ACTIVE
52
end if
53
54
ArrayPos0++
55
loop
56
57
end sub
58
59
60
// ========================
61
// Editor Subs
62
// ========================
63
64
sub RSDKDraw
65
DrawSprite(0)
66
end sub
67
68
69
sub RSDKLoad
70
LoadSpriteSheet("Mission/Objects.gif")
71
SpriteFrame(-16, -16, 32, 32, 1, 34) // #0 - "Top Right" Editor Icon
72
73
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
74
end sub
75
76