Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/DAGarden/SlowBird.txt
1319 views
1
//----------------Sonic CD Slow Bird Script-------------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value1 : Object.YOffSet
7
#alias Object.Value2 : Object.Wobble
8
#alias Object.Value3 : Object.Timer
9
#alias Object.PropertyValue : Object.WobbleIncrease
10
11
// States
12
#alias 0 : SLOWBIRD_SETUP
13
#alias 1 : SLOWBIRD_MOVEMENT
14
15
16
sub ObjectMain
17
Object.Timer++
18
Object.Timer %= 192
19
if Object.Timer > 133
20
if Object.Direction == FACING_RIGHT
21
Object.XPos += 0x10000
22
else
23
Object.XPos -= 0x10000
24
end if
25
else
26
if Object.Direction == FACING_RIGHT
27
Object.XPos += 0x4000
28
else
29
Object.XPos -= 0x4000
30
end if
31
end if
32
33
switch Object.State
34
case SLOWBIRD_SETUP
35
Object.YOffSet = Object.YPos
36
Object.State++
37
break
38
39
case SLOWBIRD_MOVEMENT
40
Object.Wobble += Object.WobbleIncrease
41
Object.Wobble &= 511
42
Sin(Object.YPos, Object.Wobble)
43
Object.YPos <<= 10
44
Object.YPos += Object.YOffSet
45
break
46
47
end switch
48
49
if Object.OutOfBounds == true
50
Object.Type = TypeName[Blank Object]
51
end if
52
end sub
53
54
55
sub ObjectDraw
56
TempValue0 = Object.AnimationSpeed
57
TempValue0 >>= 4
58
DrawSpriteFX(TempValue0, FX_FLIP, Object.XPos, Object.YPos)
59
60
if Object.Timer > 133
61
Object.AnimationSpeed += 4
62
else
63
Object.AnimationSpeed++
64
end if
65
Object.AnimationSpeed &= 31
66
end sub
67
68
69
sub ObjectStartup
70
LoadSpriteSheet("DAGarden/Objects.gif")
71
72
SpriteFrame(-8, -9, 16, 16, 466, 577) // Blue Bird Frame 0
73
SpriteFrame(-8, -8, 16, 16, 483, 577) // Blue Bird Frame 1
74
end sub
75
76
77
// ========================
78
// Editor Subs
79
// ========================
80
81
sub RSDKDraw
82
DrawSprite(0)
83
end sub
84
85
86
sub RSDKLoad
87
LoadSpriteSheet("DAGarden/Objects.gif")
88
SpriteFrame(-8, -9, 16, 16, 466, 577) // Blue Bird Frame 0
89
90
// Although used by the object, it shouldn't be set from the editor
91
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
92
end sub
93
94