Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 1/Scripts/LZ/VerticalWrap.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Vertical Wrap Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
private alias object.yvel : player.yvel
13
private alias object.ypos : player.ypos
14
15
16
// ========================
17
// Events
18
// ========================
19
20
event ObjectUpdate
21
// First, check for bottom->top wrap
22
if player[0].yvel >= 0
23
if camera[0].ypos >= 2168
24
temp1 = player[0].ypos
25
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
26
temp0 = player[currentPlayer].ypos
27
temp0 -= temp1
28
Abs(temp0)
29
if temp0 < 0x8C0000
30
player[currentPlayer].ypos -= 0x8000000
31
end if
32
next
33
camera[0].ypos -= 0x800
34
screen.yoffset -= 0x800
35
end if
36
end if
37
38
// Then, check for top->bottom wrap
39
if player[0].yvel <= 0
40
if camera[0].ypos <= 120
41
temp1 = player[0].ypos
42
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
43
temp0 = player[currentPlayer].ypos
44
temp0 -= temp1
45
Abs(temp0)
46
if temp0 < 0x8C0000
47
player[currentPlayer].ypos += 0x8000000
48
end if
49
next
50
camera[0].ypos += 0x800
51
screen.yoffset += 0x800
52
end if
53
end if
54
end event
55
56
57
// ========================
58
// Editor Events
59
// ========================
60
61
event RSDKDraw
62
DrawSprite(0)
63
end event
64
65
66
event RSDKLoad
67
LoadSpriteSheet("Global/Display.gif")
68
SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #0
69
70
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
71
end event
72
73