Path: blob/master/Sonic 2/Scripts/DEZ/MechaSonicSpike.txt
1482 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: MechaSonicSpike Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Events9// ========================1011event ObjectUpdate12object.xpos += object.xvel13object.ypos += object.yvel1415if object.outOfBounds == true16// Unload if out of bounds17object.type = TypeName[Blank Object]18end if1920// Check collision with players21foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)22BoxCollisionTest(C_TOUCH, object.entityPos, -4, -4, 4, 4, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)23if checkResult == true24CallFunction(Player_Hit)25end if26next27end event282930event ObjectDraw31DrawSprite(object.frame)32end event333435event ObjectStartup36// Interestingly, even though the correct sprites are present on the sheet, this object forgoes using the MBZ sprites even when in MBZ37LoadSpriteSheet("DEZ/Objects.gif")3839SpriteFrame(-4, -8, 7, 16, 296, 50) // Pointing up40SpriteFrame(-5, -5, 13, 13, 304, 50) // Upwards-left41SpriteFrame(-8, -3, 16, 7, 318, 50) // Left42SpriteFrame(-5, -8, 13, 13, 335, 50) // Down-left43SpriteFrame(-4, -8, 7, 16, 349, 50) // Down44SpriteFrame(-8, -8, 13, 13, 357, 50) // Down-right45SpriteFrame(-8, -3, 16, 7, 371, 50) // Right46SpriteFrame(-8, -5, 13, 13, 388, 50) // Up-right47end event484950// ========================51// Editor Events52// ========================5354event RSDKDraw55DrawSprite(0)56end event575859event RSDKLoad60CheckCurrentStageFolder("Zone12")61if checkResult == true62LoadSpriteSheet("DEZ/Objects.gif")63SpriteFrame(-4, -8, 7, 16, 296, 50)64else65// Decomp note - may as well, y'know?66// Who knows, it might even help initial editor load times a tad bit67LoadSpriteSheet("MBZ/Objects.gif")68SpriteFrame(-4, -8, 7, 16, 808, 50)69end if7071SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")72end event737475