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/GHZ/WaterfallSound.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Waterfall Sound Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
// A pair of unused values, reset once then never seen again...
13
// -> Bit of a shot in the dark, but these may have been early versions of the
14
// GHZSetup static values before the waterfall sound system got reworked
15
// - This coincides with how the rest of GHZ is formatted like RSDKv3 scripts as well,
16
// given that static variables didn't exist back then
17
private alias object.value0 : object.unused1
18
private alias object.value1 : object.unused2
19
20
// Player Aliases
21
private alias object.xpos : player.xpos
22
23
24
// ========================
25
// Events
26
// ========================
27
28
event ObjectUpdate
29
object.priority = PRIORITY_ACTIVE
30
31
GHZSetup_playWaterfallSfx = true
32
33
// Check if the object is out of bounds
34
temp0 = camera[0].xpos
35
temp0 -= object.ixpos
36
Abs(temp0)
37
temp0 -= 128
38
if temp0 > screen.xcenter
39
object.priority = PRIORITY_XBOUNDS
40
// these aren't used anywhere else...
41
object.unused1 = 0
42
object.unused2 = 0
43
end if
44
45
// Make the SFX pan relative to player 1's position
46
GHZSetup_waterfallPan = object.xpos
47
GHZSetup_waterfallPan -= player[0].xpos
48
GHZSetup_waterfallPan >>= 18
49
end event
50
51
52
event ObjectStartup
53
foreach (TypeName[Waterfall Sound], arrayPos0, ALL_ENTITIES)
54
object[arrayPos0].priority = PRIORITY_XBOUNDS
55
next
56
end event
57
58
59
// ========================
60
// Editor Events
61
// ========================
62
63
event RSDKDraw
64
DrawSprite(0)
65
end event
66
67
68
event RSDKLoad
69
LoadSpriteSheet("Global/Display.gif")
70
SpriteFrame(-8, -8, 16, 16, 165, 141) // small "W"
71
72
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
73
end event
74
75