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/Continue/Spotlight.txt
1481 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Spotlight Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Events
10
// ========================
11
12
event ObjectUpdate
13
// Empty event, it exists but there's nothing in it
14
end event
15
16
17
event ObjectDraw
18
DrawSprite(0)
19
end event
20
21
22
event ObjectStartup
23
LoadSpriteSheet("Special/Objects.gif")
24
25
// 0 - Spotlight Frame
26
SpriteFrame(-24, -6, 48, 13, 350, 376)
27
28
foreach (TypeName[Spotlight], arrayPos0, ALL_ENTITIES)
29
object[arrayPos0].drawOrder = 3
30
31
// Move the Spotlight to the middle of the screen
32
object[arrayPos0].xpos = screen.xcenter
33
object[arrayPos0].xpos <<= 16
34
35
if object[1].type != TypeName[Blank Object]
36
// If there's a second player, move the spotlights to make room for two
37
if object[arrayPos0].propertyValue == 0
38
object[arrayPos0].xpos += 0x200000
39
else
40
object[arrayPos0].xpos -= 0x200000
41
end if
42
end if
43
next
44
end event
45
46
47
// ========================
48
// Editor Events
49
// ========================
50
51
event RSDKDraw
52
DrawSprite(0)
53
end event
54
55
56
event RSDKLoad
57
LoadSpriteSheet("Special/Objects.gif")
58
SpriteFrame(-24, -6, 48, 13, 350, 376)
59
60
SetVariableAlias(ALIAS_VAR_PROPVAL, "playerID")
61
end event
62
63