Path: blob/master/Sonic 1/Scripts/SBZ/VerticalWrap.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Vertical Wrap Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011// Player Aliases12private alias object.ypos : player.ypos13private alias object.yvel : player.yvel141516// ========================17// Events18// ========================1920event ObjectUpdate21// Screen Wrap (Bottom)22if player[0].yvel >= 023if camera[0].ypos >= 216824temp1 = player[0].ypos25foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)26temp0 = player[currentPlayer].ypos27temp0 -= temp128Abs(temp0)29if temp0 < 0x8C000030player[currentPlayer].ypos -= 0x80000003132// Move the background too so that it doesn't visibly warp33tileLayer[2].scrollPos += 0x100000034end if35next3637camera[0].ypos -= 0x80038screen.yoffset -= 0x80039end if40end if4142// Screen Wrap (Top)43if player[0].yvel <= 044if camera[0].ypos <= 12045temp1 = player[0].ypos46foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)47temp0 = player[currentPlayer].ypos48temp0 -= temp149Abs(temp0)50if temp0 < 0x8C000051player[currentPlayer].ypos += 0x80000005253// To make sure it doesn't visibly warp, move the BG around too54tileLayer[2].scrollPos -= 0x100000055end if56next5758camera[0].ypos += 0x80059screen.yoffset += 0x80060end if61end if62end event636465// ========================66// Editor Events67// ========================6869event RSDKDraw70DrawSprite(0)71end event727374event RSDKLoad75LoadSpriteSheet("Global/Display.gif")76SpriteFrame(-16, -16, 32, 32, 1, 143)7778SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")79end event808182