Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R4/FaceProjectile.txt
1319 views
1
//---------------Sonic CD Face Projectile Script--------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value1 : Object.XVelocity
7
8
9
sub ObjectMain
10
Object.XPos += Object.XVelocity
11
if Object.OutOfBounds == true
12
Object.Type = TypeName[Blank Object]
13
end if
14
end sub
15
16
17
sub ObjectPlayerInteraction
18
if Player.YVelocity > -0xE0000
19
PlayerObjectCollision(C_TOUCH, -13, -8, 13, 8)
20
if CheckResult == true
21
if Object.Direction == FACING_RIGHT
22
if Player.Left == true
23
if Player.Speed > -0x30000
24
Player.Speed = -0x30000
25
end if
26
#platform: Use_Origins
27
if Player.Direction == FACING_LEFT
28
if Player.Animation == ANI_GLIDING
29
Player.Speed *= -1
30
end if
31
end if
32
#endplatform
33
else
34
if Player.Right == true
35
Player.Speed = -0x20000
36
else
37
Player.Speed = -0x30000
38
end if
39
#platform: Use_Origins
40
if Player.Direction == FACING_LEFT
41
if Player.Animation == ANI_GLIDING
42
Player.Speed *= -1
43
end if
44
end if
45
#endplatform
46
end if
47
else
48
if Player.Right == true
49
if Player.Speed < 0x30000
50
Player.Speed = 0x30000
51
end if
52
else
53
if Player.Left == true
54
Player.Speed = 0x20000
55
else
56
Player.Speed = 0x30000
57
end if
58
#platform: Use_Origins
59
if Player.Direction == FACING_LEFT
60
if Player.Animation == ANI_GLIDING
61
Player.Speed *= -1
62
end if
63
end if
64
#endplatform
65
end if
66
end if
67
#platform: Use_Origins
68
if Player.Animation == ANI_GLIDING_DROP
69
Player.Speed = 0
70
end if
71
#endplatform
72
end if
73
end if
74
end sub
75
76
77
sub ObjectDraw
78
if Object.AnimationTimer > 9
79
Object.Direction += 2
80
DrawSpriteFX(0, FX_FLIP, Object.XPos, Object.YPos)
81
Object.Direction -= 2
82
else
83
DrawSpriteFX(0, FX_FLIP, Object.XPos, Object.YPos)
84
end if
85
86
Object.AnimationTimer++
87
Object.AnimationTimer %= 20
88
end sub
89
90
91
sub ObjectStartup
92
LoadSpriteSheet("R4/Objects2.gif")
93
94
SpriteFrame(-16, -8, 32, 16, 152, 159) // #0 - Face Projectile
95
end sub
96
97
98
// ========================
99
// Editor Subs
100
// ========================
101
102
sub RSDKDraw
103
DrawSprite(0)
104
end sub
105
106
107
sub RSDKLoad
108
LoadSpriteSheet("R4/Objects2.gif")
109
110
SpriteFrame(-16, -8, 32, 16, 152, 159) // #0 - Face Projectile
111
112
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
113
end sub
114
115