0% found this document useful (0 votes)
32 views3 pages

Sonic 1/Sonic 2 Death Event Script

The document describes the Death Event Object for the RSDK Project: Sonic 1/Sonic 2, detailing the script's functionality and structure. It includes event handling for different states, such as managing player lives, music volume, and screen transitions upon death. Additionally, it outlines the drawing and loading of sprites related to the death event.

Uploaded by

josepharturo2009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views3 pages

Sonic 1/Sonic 2 Death Event Script

The document describes the Death Event Object for the RSDK Project: Sonic 1/Sonic 2, detailing the script's functionality and structure. It includes event handling for different states, such as managing player lives, music volume, and screen transitions upon death. Additionally, it outlines the drawing and loading of sprites related to the death event.

Uploaded by

josepharturo2009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

// ----------------------------------

// RSDK Project: Sonic 1/Sonic 2


// Script Description: Death Event Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 7 : TYPE_DEATHEVENT

// Static Values

// Tables

event ObjectMain
switch [Link]
case 0
case 1
temp0 = [Link]
temp0 -= 72
if object.value1 < temp0
object.value1 += 16
if object.value1 > temp0
object.value1 = temp0
end if
end if
temp0 += 80
if object.value2 > temp0
object.value2 -= 16
if object.value2 < temp0
object.value2 = temp0
end if
end if
if object.value3 < 288
object.value3 += 4
else
if [Link] == 0
recStageList = [Link]
recStage = [Link]
[Link] = PRESENTATION_STAGE
if [Link] == 0
[Link] = 0
[Link] = 8
CallNativeFunction2(ShowPromoPopup, 0,
"GameOverPromo")
else
[Link] = 4
end if
lampPostID = 0
if [Link] == 1
arrayPos1 = [Link]
arrayPos1 <<= 3
arrayPos1++
if saveRAM[arrayPos1] < 3
saveRAM[arrayPos1] = 3
end if
arrayPos1++
saveRAM[arrayPos1] = 0
arrayPos1++
saveRAM[arrayPos1] = 0xC350
[Link] = 0
WriteSaveRAM()
end if
else
if [Link] == 1
arrayPos1 = [Link]
arrayPos1 <<= 3
arrayPos1++
saveRAM[arrayPos1] = [Link]
WriteSaveRAM()
end if
end if
if [Link] == 1
recMilliSeconds = 0
recSeconds = 0
recMinutes = 0
end if
LoadStage()
end if
if object.value3 > 0
[Link] -= 2
SetScreenFade(0, 0, 0, object.value3)
else
if [Link] == 1
object.value3 = 0
end if
if [Link] == 1
object.value3 = 0
end if
if [Link] == 1
object.value3 = 0
end if
CheckTouchRect(0, 0, [Link], [Link])
if checkResult > -1
object.value3 = 0
end if
end if
break
case 2
if object.value3 < 288
[Link] -= 2
object.value3 += 4
else
if [Link] == 1
arrayPos1 = [Link]
arrayPos1 <<= 3
arrayPos1++
saveRAM[arrayPos1] = [Link]
WriteSaveRAM()
end if
LoadStage()
end if
SetScreenFade(0, 0, 0, object.value3)
break
case 3
if object.value3 < 288
[Link] -= 2
object.value3 += 4
else
[Link] = 0x186A0
[Link] = 0
lampPostID = 0
recMilliSeconds = 0
recSeconds = 0
recMinutes = 0
[Link] = 0
[Link] = 0
[Link] = 0
[Link] = 8
end if
SetScreenFade(0, 0, 0, object.value3)
break
end switch
end event

event ObjectDraw
switch [Link]
case 0
DrawSpriteScreenXY(0, object.value1, 96)
DrawSpriteScreenXY(2, object.value2, 96)
break
case 1
DrawSpriteScreenXY(1, object.value1, 96)
DrawSpriteScreenXY(2, object.value2, 96)
break
end switch
end event

event ObjectStartup
LoadSpriteSheet("Global/[Link]")
SpriteFrame(0, 0, 64, 16, 1, 239)
SpriteFrame(0, 0, 56, 16, 66, 239)
SpriteFrame(0, 0, 64, 16, 123, 239)
end event

event RSDKDraw
DrawSprite(0)
end event

event RSDKLoad
LoadSpriteSheet("Global/[Link]")
SpriteFrame(-16, -16, 32, 32, 1, 143)
end event

You might also like