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/SBZ/VerticalWrap.txt
1480 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
// Player Aliases
13
private alias object.ypos : player.ypos
14
private alias object.yvel : player.yvel
15
16
17
// ========================
18
// Events
19
// ========================
20
21
event ObjectUpdate
22
// Screen Wrap (Bottom)
23
if player[0].yvel >= 0
24
if camera[0].ypos >= 2168
25
temp1 = player[0].ypos
26
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
27
temp0 = player[currentPlayer].ypos
28
temp0 -= temp1
29
Abs(temp0)
30
if temp0 < 0x8C0000
31
player[currentPlayer].ypos -= 0x8000000
32
33
// Move the background too so that it doesn't visibly warp
34
tileLayer[2].scrollPos += 0x1000000
35
end if
36
next
37
38
camera[0].ypos -= 0x800
39
screen.yoffset -= 0x800
40
end if
41
end if
42
43
// Screen Wrap (Top)
44
if player[0].yvel <= 0
45
if camera[0].ypos <= 120
46
temp1 = player[0].ypos
47
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
48
temp0 = player[currentPlayer].ypos
49
temp0 -= temp1
50
Abs(temp0)
51
if temp0 < 0x8C0000
52
player[currentPlayer].ypos += 0x8000000
53
54
// To make sure it doesn't visibly warp, move the BG around too
55
tileLayer[2].scrollPos -= 0x1000000
56
end if
57
next
58
59
camera[0].ypos += 0x800
60
screen.yoffset += 0x800
61
end if
62
end if
63
end event
64
65
66
// ========================
67
// Editor Events
68
// ========================
69
70
event RSDKDraw
71
DrawSprite(0)
72
end event
73
74
75
event RSDKLoad
76
LoadSpriteSheet("Global/Display.gif")
77
SpriteFrame(-16, -16, 32, 32, 1, 143)
78
79
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
80
end event
81
82