Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R1/Bullet.txt
1319 views
1
//---------------Sonic CD Kamemusi Bullet Script--------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.FrameTimer
7
#alias Object.Value1 : Object.XVelocity
8
#alias Object.Value2 : Object.YVelocity
9
10
11
sub ObjectMain
12
Object.YVelocity += 0x2000
13
Object.XPos += Object.XVelocity
14
Object.YPos += Object.YVelocity
15
16
if Object.OutOfBounds == true
17
Object.Type = TypeName[Blank Object]
18
else // if it goes above the visible screen, delete them
19
TempValue0 = Screen.YOffset
20
TempValue0 -= 8
21
TempValue0 <<= 16
22
if Object.YPos < TempValue0
23
Object.Type = TypeName[Blank Object]
24
end if
25
26
end if
27
end sub
28
29
30
sub ObjectPlayerInteraction
31
PlayerObjectCollision(C_TOUCH, -4, -4, 4, 4)
32
if CheckResult == true
33
CallFunction(Player_Hit)
34
end if
35
end sub
36
37
38
sub ObjectDraw
39
DrawSprite(Object.Frame)
40
41
Object.FrameTimer++
42
if Object.FrameTimer > 2
43
Object.FrameTimer = 0
44
45
Object.Frame++
46
Object.Frame &= 3
47
end if
48
end sub
49
50
51
sub ObjectStartup
52
LoadSpriteSheet("R1/Objects.gif")
53
54
SpriteFrame(-4, -4, 8, 8, 166, 34) // #0 - Small Bullet Frame 0
55
SpriteFrame(-4, -4, 8, 8, 175, 34) // #1 - Small Bullet Frame 1
56
SpriteFrame(-6, -6, 12, 12, 101, 93) // #2 - Big Bullet Frame 0
57
SpriteFrame(-6, -6, 12, 12, 114, 93) // #3 - Big Bullet Frame 1
58
end sub
59
60
61
// ========================
62
// Editor Subs
63
// ========================
64
65
sub RSDKDraw
66
DrawSprite(0)
67
end sub
68
69
70
sub RSDKLoad
71
LoadSpriteSheet("R1/Objects.gif")
72
SpriteFrame(-4, -4, 8, 8, 166, 34) // #0 - Small Bullet
73
74
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
75
end sub
76
77