Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R7/InvBarrier.txt
1319 views
1
//-------------Sonic CD Invisible Barrier Script--------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
6
sub ObjectPlayerInteraction
7
if Player.Angle == 0
8
PlayerObjectCollision(C_TOUCH, -16, -14, 16, 16)
9
10
if CheckResult == true
11
// Push the player out
12
13
Player.XPos = Player.CollisionLeft
14
Player.XPos <<= 16
15
Player.XPos += Object.XPos
16
Player.XPos -= 0x100000 // 10 pixels left
17
end if
18
end if
19
20
end sub
21
22
23
// ========================
24
// Editor Subs
25
// ========================
26
27
sub RSDKDraw
28
DrawSprite(0)
29
30
// Draw the object's switch's hitbox
31
32
TempValue0 = Object.iXPos
33
TempValue0 -= 16
34
TempValue1 = Object.iYPos
35
TempValue1 -= 14
36
DrawRectOutline(TempValue0, TempValue1, 32, 30, 255, 255, 255, 255)
37
end sub
38
39
40
sub RSDKLoad
41
LoadSpriteSheet("Global/Display.gif")
42
SpriteFrame(-16, -14, 32, 30, 1, 145) // "Script" Icon - it's a tad bit large for the actual hitbox but I can't think of a better fit...
43
44
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
45
end sub
46
47