Path: blob/master/Sonic 2/Scripts/WFZ/BeltPlatform.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Belt Platform Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timer12private alias object.value1 : object.stoodPlayers1314// States15private alias 0 : BELTPLATFORM_INACTIVE16private alias 1 : BELTPLATFORM_APPEARING17private alias 2 : BELTPLATFORM_MOVING18private alias 3 : BELTPLATFORM_DISAPPEARING1920// Player Aliases21private alias object.ypos : player.ypos222324// ========================25// Events26// ========================2728event ObjectUpdate29switch object.state30case BELTPLATFORM_INACTIVE31break3233case BELTPLATFORM_APPEARING34object.animationTimer++35if object.animationTimer == 436object.animationTimer = 037object.frame--38if object.frame == 039object.state = BELTPLATFORM_MOVING40end if41end if42break4344case BELTPLATFORM_MOVING45object.ypos += object.yvel4647object.timer--48if object.timer == 049object.state = BELTPLATFORM_DISAPPEARING50end if5152temp2 = 053foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)54GetBit(temp0, object.stoodPlayers, temp2)55if temp0 == true56player[currentPlayer].ypos += object.yvel57end if5859SetBit(object.stoodPlayers, temp2, false)60BoxCollisionTest(C_PLATFORM, object.entityPos, -24, -4, 24, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)61if checkResult == true62SetBit(object.stoodPlayers, temp2, true)63end if64temp2++65next66break6768case BELTPLATFORM_DISAPPEARING69object.animationTimer++70if object.animationTimer == 471object.animationTimer = 072object.frame++73if object.frame == 374object.state = BELTPLATFORM_INACTIVE75end if76end if77break7879end switch8081temp0 = object.xpos82temp0 >>= 1683temp0 -= camera[0].xpos84Abs(temp0)85temp0 -= 12886if temp0 > screen.xcenter87object.state = BELTPLATFORM_INACTIVE88object.priority = PRIORITY_BOUNDS89end if90end event919293event ObjectDraw94if object.state > BELTPLATFORM_INACTIVE95DrawSprite(object.frame)96end if97end event9899100event ObjectStartup101LoadSpriteSheet("SCZ/Objects.gif")102SpriteFrame(-24, -4, 48, 8, 80, 177)103SpriteFrame(-24, -3, 48, 6, 80, 186)104SpriteFrame(-24, -2, 48, 4, 80, 193)105end event106107108// ========================109// Editor Events110// ========================111112event RSDKDraw113DrawSprite(0)114end event115116117event RSDKLoad118LoadSpriteSheet("SCZ/Objects.gif")119SpriteFrame(-24, -4, 48, 8, 80, 177)120121// In the scene it's normally set to 1, it doesn't seem to do anything though?122SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")123end event124125126