Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R5/ForegroundPiece.txt
1319 views
1
//--------------Sonic CD Foreground Piece Script--------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
6
sub ObjectDraw
7
8
// Nothing complex needs to happen here, just draw the sprite with the sprite ID specified
9
DrawSprite(Object.PropertyValue)
10
11
end sub
12
13
14
sub ObjectStartup
15
LoadSpriteSheet("R5/Objects3.gif")
16
17
// Foreground Piece Frames, they're all mostly just tiny sprites
18
SpriteFrame(-26, -4, 52, 8, 165, 1)
19
SpriteFrame(-4, -26, 8, 52, 218, 1)
20
SpriteFrame(-16, -4, 32, 8, 165, 10)
21
SpriteFrame(-8, -4, 16, 8, 165, 10)
22
SpriteFrame(-4, -16, 8, 32, 227, 1)
23
SpriteFrame(-4, -8, 8, 16, 227, 1)
24
SpriteFrame(-20, -4, 40, 8, 165, 19)
25
SpriteFrame(-20, -4, 40, 8, 165, 28)
26
SpriteFrame(-4, -20, 8, 40, 236, 1)
27
SpriteFrame(-4, -20, 8, 40, 245, 1)
28
SpriteFrame(-20, -4, 40, 8, 165, 37)
29
SpriteFrame(-20, -4, 40, 8, 165, 46)
30
SpriteFrame(-4, -20, 8, 40, 236, 42)
31
SpriteFrame(-4, -20, 8, 40, 245, 42)
32
33
// Cycle through all Foreground Piece Objects in the level
34
ArrayPos0 = 32
35
while ArrayPos0 < 1056
36
if Object[ArrayPos0].Type == TypeName[Foreground Piece]
37
38
// Give them all a Draw Order of 4 in order to, well, truly make them *Foreground* Pieces
39
Object[ArrayPos0].DrawOrder = 4
40
41
end if
42
43
ArrayPos0++
44
loop
45
46
end sub
47
48
49
// ========================
50
// Editor Subs
51
// ========================
52
53
sub RSDKDraw
54
DrawSprite(Object.PropertyValue)
55
end sub
56
57
58
sub RSDKLoad
59
LoadSpriteSheet("R5/Objects3.gif")
60
SpriteFrame(-26, -4, 52, 8, 165, 1)
61
SpriteFrame(-4, -26, 8, 52, 218, 1)
62
SpriteFrame(-16, -4, 32, 8, 165, 10)
63
SpriteFrame(-8, -4, 16, 8, 165, 10)
64
SpriteFrame(-4, -16, 8, 32, 227, 1)
65
SpriteFrame(-4, -8, 8, 16, 227, 1)
66
SpriteFrame(-20, -4, 40, 8, 165, 19)
67
SpriteFrame(-20, -4, 40, 8, 165, 28)
68
SpriteFrame(-4, -20, 8, 40, 236, 1)
69
SpriteFrame(-4, -20, 8, 40, 245, 1)
70
SpriteFrame(-20, -4, 40, 8, 165, 37)
71
SpriteFrame(-20, -4, 40, 8, 165, 46)
72
SpriteFrame(-4, -20, 8, 40, 236, 42)
73
SpriteFrame(-4, -20, 8, 40, 245, 42)
74
75
SetVariableAlias(ALIAS_VAR_PROPVAL, "spriteID")
76
end sub
77
78