Path: blob/main/Scripts/R8/SpinningPlatform.txt
1319 views
//-------------Sonic CD Spinning Platform Script--------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Alias5#alias Object[19].Rotation : R8Setup.Rotation678sub ObjectMain9// All Spinning Platforms are synced together, via the Object in slot 19 which10// should be the R8 Setup Object11Object.Rotation = R8Setup.Rotation1213// And then bump that rotation as needed14Object.Rotation += Object.PropertyValue1516// Keep the rotation limited to 143, as with the R8 Setup's rotation value as well17Object.Rotation %= 1441819end sub202122sub ObjectPlayerInteraction23// Only check for Collision when the Platform is in its normal position24if Object.Rotation < 12125PlayerObjectCollision(C_PLATFORM, -16, -5, 16, 11)26end if2728end sub293031sub ObjectDraw32if Object.Rotation < 12133// Draw the normal Platform frame34DrawSprite(0)35else3637// Use different drawing routines for the Platform's different possible angles3839TempValue0 = Object.Rotation40TempValue0 -= 12041TempValue0 >>= 14243switch TempValue044case 045case 646DrawSprite(1)47break4849case 150case 751DrawSprite(2)52break5354case 255case 856DrawSprite(3)57break5859case 360case 961Object.Direction = FACING_LEFT62DrawSpriteFX(4, FX_FLIP, Object.XPos, Object.YPos)63break6465case 466case 1067Object.Direction = FACING_LEFT68DrawSpriteFX(5, FX_FLIP, Object.XPos, Object.YPos)69break7071case 572case 1173DrawSprite(0)74break7576end switch77end if7879end sub808182sub ObjectStartup83LoadSpriteSheet("R8/Objects.gif")8485SpriteFrame(-16, -8, 32, 16, 107, 98) // #0 - Platform Horizontal86SpriteFrame(-16, -12, 32, 24, 107, 115) // #1 - Platform Tilted frame 087SpriteFrame(-12, -16, 24, 32, 230, 34) // #2 - Platform Tilted frame 18889SpriteFrame(-8, -16, 16, 32, 239, 212) // #3 - Platform Vertical90SpriteFrame(-12, -16, 24, 32, 230, 34) // #4 - Platform Tilted frame 091SpriteFrame(-16, -12, 32, 24, 107, 115) // #5 - Platform Tilted frame 19293end sub949596// ========================97// Editor Subs98// ========================99100sub RSDKDraw101DrawSprite(0)102end sub103104105sub RSDKLoad106LoadSpriteSheet("R8/Objects.gif")107SpriteFrame(-16, -8, 32, 16, 107, 98)108109SetVariableAlias(ALIAS_VAR_PROPVAL, "SpinOffset")110end sub111112113