0% found this document useful (0 votes)
11 views2 pages

YBound Adjust

The document describes a script for the RSDK Project related to Sonic 1/Sonic 2, specifically for adjusting the Y boundary of objects. It includes event handlers for object initialization, main functionality, drawing, and loading sprites, with conditions for setting boundaries based on object positions. The script is authored by Christian Whitehead and Simon Thomley and unpacked by Rubberduckycooly.

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)
11 views2 pages

YBound Adjust

The document describes a script for the RSDK Project related to Sonic 1/Sonic 2, specifically for adjusting the Y boundary of objects. It includes event handlers for object initialization, main functionality, drawing, and loading sprites, with conditions for setting boundaries based on object positions. The script is authored by Christian Whitehead and Simon Thomley and unpacked by Rubberduckycooly.

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/ 2

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

// RSDK Project: Sonic 1/Sonic 2


// Script Description: Y Bound Adjust Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 34 : TYPE_YBOUNDADJUST

// Static Values

// Tables

event ObjectMain
if screen.cameraTarget == 0
if object.propertyValue == 0
temp0 = object[0].xpos
temp0 -= object.xpos
Abs(temp0)
if temp0 < 0x200000
stage.newYBoundary2 = object.iypos
stage.deathBoundary = object.ypos
end if
else
if object[0].ypos < object.ypos
if object[0].ypos > object[+1].ypos
temp0 = object[0].xpos
temp0 -= object.xpos
Abs(temp0)
if temp0 < 0x200000
stage.newYBoundary2 = object.iypos
stage.deathBoundary = object.ypos
end if
end if
end if
end if
end if
end event

event ObjectStartup
foreach (TypeName[Y Bound Adjust], arrayPos0, ALL_ENTITIES)
if object[arrayPos0].propertyValue == 0
object[arrayPos0].priority = PRIORITY_XBOUNDS
temp0 = object[0].xpos
temp0 -= object[arrayPos0].xpos
Abs(temp0)
if temp0 < 0x200000
stage.curYBoundary2 = object[arrayPos0].iypos
stage.deathBoundary = object[arrayPos0].ypos
end if
else
object[arrayPos0].priority = PRIORITY_XBOUNDS
arrayPos1 = arrayPos0
arrayPos1++
if object[0].ypos < object[arrayPos0].ypos
if object[0].ypos > object[arrayPos1].ypos
temp0 = object[0].xpos
temp0 -= object[arrayPos0].xpos
Abs(temp0)
if temp0 < 0x200000
stage.curYBoundary2 = object[arrayPos0].iypos
stage.deathBoundary = object[arrayPos0].ypos
end if
end if
end if
end if
next
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