Path: blob/main/Scripts/Title/Sonic.txt
1319 views
//-------------------Sonic CD Sonic Script--------------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer67// States8#alias 0 : SONIC_SETUP9#alias 1 : SONIC_TURNING1011// Control Mode12#alias 0 : CONTROLMODE_NORMAL1314// Players15#alias 0 : PLAYER_SONIC_A161718sub ObjectDraw19// Fill the screen with the blue background color20DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 96, 255)2122switch Object.State23case SONIC_SETUP24if Object.Alpha > 825// Fade him in2627DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)28end if2930if Object.Timer < 25631Object.Timer += 83233// Object.Alpha is a byte so it's prone to overflow, which is why we're doing this3435if Object.Timer < 25636Object.Alpha = Object.Timer37else38// Cap it at 25539Object.Alpha = 25540end if41else42if Object.Timer < 27243Object.Timer++44else45Object.Timer = 046Object.State = SONIC_TURNING4748// Reset some stuff49LampPost.Check = 050Player.ControlMode = CONTROLMODE_NORMAL51Stage.PlayerListPos = PLAYER_SONIC_A // PLAYER_SONIC in origins5253// Start the music!54PlayMusic(Options.Soundtrack)55end if56end if57break5859case SONIC_TURNING60TempValue0 = Object.Timer61TempValue0 >>= 262DrawSprite(TempValue0)6364// Get Sonic's Arm Position65TempValue0 = 1166TempValue0 += Screen.CenterX6768// If at a point where Sonic's sprite is armless, then give him his arm back69if Object.Timer > 1570DrawSpriteScreenXY(5, TempValue0, 72)71end if7273Object.Timer++74if Object.Timer > 1975ResetObjectEntity(Object.EntityNo, TypeName[Logo], 0, Object.XPos, Object.YPos)76Object.Timer = 2567778// Place some other Title Screen elements into the scene now7980ArrayPos0 = Object.EntityNo81ArrayPos0 -= 28283// First, add the Background into the scene, at Object[-2]84Object[ArrayPos0].Type = TypeName[Background]85Object[ArrayPos0].DrawOrder = 08687// There's nothing on this layer anyway, but may as well I guess?88Stage[2].ActiveLayer = 98990ArrayPos0++9192// And then add the 3d Clouds into Object[-1]93Object[ArrayPos0].Type = TypeName[Clouds]9495#platform: Mobile96// Lite!97if Engine.TrialMode == true98if Engine.PlatformID == RETRO_ANDROID99ArrayPos0 = Object.EntityNo100ArrayPos0 += 2101ResetObjectEntity(ArrayPos0, TypeName[Lite Ribbon], 0, 0, 0)102Object[ArrayPos0].DrawOrder = 6103end if104end if105#endplatform106end if107break108109end switch110111end sub112113114sub ObjectStartup115116// Set both of the Title Screen tracks here, both of them set to not loop117SetMusicTrack("JP/TitleScreen.ogg", 0, false)118SetMusicTrack("US/TitleScreen.ogg", 1, false)119120LoadSpriteSheet("Title/Title.gif")121122SpriteFrame(-47, -89, 96, 112, 1, 203) // #0 - Sonic Turning Frame 0123SpriteFrame(-47, -89, 104, 120, 98, 203) // #1 - Sonic Turning Frame 1124SpriteFrame(-47, -96, 96, 120, 1, 316) // #2 - Sonic Turning Frame 2125SpriteFrame(-47, -96, 104, 120, 98, 324) // #3 - Sonic Turning Frame 3126SpriteFrame(-47, -96, 104, 120, 1, 1) // #4 - Sonic Base Frame127SpriteFrame(0, 0, 45, 55, 210, 203) // #5 - Sonic Base Arm Frame128129end sub130131132// ========================133// Editor Subs134// ========================135136sub RSDKDraw137DrawSprite(0)138end sub139140141sub RSDKLoad142LoadSpriteSheet("Title/Title.gif")143SpriteFrame(-47, -96, 104, 120, 1, 1)144145SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")146end sub147148149