0% found this document useful (0 votes)
3 views

Zone Button

The document contains a script for a Zone Button Object in the RSDK Project for Sonic 1/Sonic 2, authored by Christian Whitehead and Simon Thomley. It defines various events such as ObjectMain, ObjectDraw, ObjectStartup, RSDKDraw, and RSDKLoad, detailing how the button behaves and is rendered in the game. The script includes logic for handling states, drawing sprites, and loading necessary resources for the button's functionality.

Uploaded by

Jogatina animal
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)
3 views

Zone Button

The document contains a script for a Zone Button Object in the RSDK Project for Sonic 1/Sonic 2, authored by Christian Whitehead and Simon Thomley. It defines various events such as ObjectMain, ObjectDraw, ObjectStartup, RSDKDraw, and RSDKLoad, detailing how the button behaves and is rendered in the game. The script includes logic for handling states, drawing sprites, and loading necessary resources for the button's functionality.

Uploaded by

Jogatina animal
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
You are on page 1/ 3

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

// RSDK Project: Sonic 1/Sonic 2


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

//-------Aliases-------//
private alias 8 : TYPE_ZONEBUTTON

// Static Values

// Tables

event ObjectMain
switch object.state
case 0
object.value3 = object.propertyValue
object.value3 += 7
object.value7 = object.propertyValue
object.value7 += 14
object.inkEffect = INK_ALPHA
object.value1 = 64
object.value8 = object.entityPos
object.value8 -= 9
object.alpha = 256
object.state = 1
break
case 1
if options.physicalControls == 0

end if
break
case 2
break
end switch
end event

event ObjectDraw
if object[1].value3 == object.value8
temp0 = object[1].value4
temp0 >>= 1
temp0 &= 1
if object[1].state < 4
temp0 = 1
end if
else
temp0 = 0
end if
if temp0 == 1
object.value4 = 3
object.value5 = 4
object.value6 = 5
temp3 = 159
else
object.value4 = 0
object.value5 = 1
object.value6 = 2
temp3 = 110
end if
temp0 = object.value1
temp0 >>= 1
temp0 -= 4
FlipSign(temp0)
temp0 += object.xpos
temp0 += screen.xcenter
temp1 = object.ypos
temp1 += 148
DrawSpriteScreenFX(object.value4, FX_INK, temp0, temp1)
temp2 = object.value1
temp2 -= 8
EditFrame(object.value5, 0, -24, temp2, 48, 5, temp3)
DrawSpriteScreenFX(object.value5, FX_INK, temp0, temp1)
temp0 += 7
if object.value2 == 0
DrawSpriteScreenFX(6, FX_INK, temp0, temp1)
DrawSpriteScreenFX(object.value3, FX_INK, temp0, temp1)
else
DrawSpriteScreenFX(7, FX_INK, temp0, temp1)
end if
temp0--
temp0 += object.value1
temp0 -= 14
DrawSpriteScreenFX(object.value6, FX_INK, temp0, temp1)
if object.value1 == 224
temp0 -= object.value1
temp0 += 60
DrawSpriteScreenFX(object.value7, FX_INK, temp0, temp1)
end if
end event

event ObjectStartup
LoadSpriteSheet("LevelSelect/Icons.gif")
SpriteFrame(-4, -24, 4, 48, 1, 110)
SpriteFrame(0, -24, 40, 48, 5, 110)
SpriteFrame(0, -24, 4, 48, 221, 110)
SpriteFrame(-4, -24, 4, 48, 1, 159)
SpriteFrame(0, -24, 40, 48, 5, 159)
SpriteFrame(0, -24, 4, 48, 221, 159)
SpriteFrame(0, -17, 42, 34, 180, 1)
SpriteFrame(0, -17, 42, 34, 180, 1)
SpriteFrame(4, -13, 32, 24, 1, 85)
SpriteFrame(4, -13, 32, 24, 34, 85)
SpriteFrame(4, -13, 32, 24, 67, 85)
SpriteFrame(4, -13, 32, 24, 100, 85)
SpriteFrame(4, -13, 32, 24, 133, 85)
SpriteFrame(4, -13, 32, 24, 166, 85)
SpriteFrame(4, -13, 32, 24, 199, 85)
SpriteFrame(4, -3, 120, 7, 1, 223)
SpriteFrame(4, -3, 88, 7, 122, 223)
SpriteFrame(4, -3, 128, 7, 1, 231)
SpriteFrame(4, -3, 112, 7, 130, 231)
SpriteFrame(4, -3, 120, 7, 1, 239)
SpriteFrame(4, -3, 128, 7, 122, 239)
SpriteFrame(4, -3, 80, 7, 1, 247)
end event

event RSDKDraw
DrawSprite(0)
end event

event RSDKLoad
LoadSpriteSheet("Global/Display.gif")
SpriteFrame(-16, -16, 32, 32, 1, 143)
end event

You might also like