Path: blob/master/Sonic 1/Scripts/LevelSelect/BGAnimation.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: BG Animation Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.bgTimer1213// Priority14public alias 0 : PRIORITY_BOUNDS15public alias 1 : PRIORITY_ACTIVE16public alias 2 : PRIORITY_ALWAYS17public alias 3 : PRIORITY_XBOUNDS18public alias 4 : PRIORITY_XBOUNDS_DESTROY19public alias 5 : PRIORITY_INACTIVE20public alias 6 : PRIORITY_BOUNDS_SMALL21public alias 7 : PRIORITY_ACTIVE_SMALL2223// Ink Effects24public alias 0 : INK_NONE25public alias 1 : INK_BLEND26public alias 2 : INK_ALPHA27public alias 3 : INK_ADD28public alias 4 : INK_SUB2930// Flip Directions31public alias 0 : FLIP_NONE32public alias 1 : FLIP_X33public alias 2 : FLIP_Y34public alias 3 : FLIP_XY353637// ========================38// Static Values39// ========================4041public value BGAnimation_currentPreview = 0424344// ========================45// Events46// ========================4748event ObjectUpdate49object.bgTimer++50object.bgTimer &= 0x1FF51Sin(temp0, object.bgTimer)5253// The background is all chunks and tiles in the level so "animating" it is actually just moving the camera around54if temp0 > 055if temp0 < 3256// Second frame57screen.yoffset = 25658else59// First frame60screen.yoffset = 061end if62else63if temp0 > -3264// Third frame65screen.yoffset = 51266else67// Fourth frame68screen.yoffset = 76869end if70end if71end event727374event ObjectDraw75if stage.actNum == 176// If in the Level Select scene, then draw the zone preview too7778temp0 = screen.xcenter7980// Frame81DrawSpriteScreenXY(9, temp0, 198)8283// Zone preview84DrawSpriteScreenXY(BGAnimation_currentPreview, temp0, 198)85end if86end event878889event ObjectStartup90LoadSpriteSheet("LevelSelect/Icons.gif")9192// Set all BG Animation objects to be active93foreach (TypeName[BG Animation], arrayPos0, ALL_ENTITIES)94// Set all BG Animation objects to be active95object[arrayPos0].priority = PRIORITY_ACTIVE96next9798// Preview frames99SpriteFrame(56, -12, 32, 24, 0, 50) // Sonic vibin'100SpriteFrame(56, -12, 32, 24, 1, 85) // GHZ101SpriteFrame(56, -12, 32, 24, 34, 85) // MZ102SpriteFrame(56, -12, 32, 24, 67, 85) // SYZ103SpriteFrame(56, -12, 32, 24, 100, 85) // LZ104SpriteFrame(56, -12, 32, 24, 133, 85) // SLZ105SpriteFrame(56, -12, 32, 24, 166, 85) // SBZ106SpriteFrame(56, -12, 32, 24, 199, 85) // FZ107SpriteFrame(56, -12, 32, 24, 180, 60) // Special Stage108109// Frame110SpriteFrame(32, -24, 80, 50, 0, 0)111112// Set the preview to GHZ by default113BGAnimation_currentPreview = 1114end event115116117// ========================118// Editor Events119// ========================120121event RSDKDraw122DrawSprite(1)123DrawSprite(0)124end event125126127event RSDKLoad128LoadSpriteSheet("LevelSelect/Icons.gif")129SpriteFrame(56, -12, 32, 24, 0, 50)130SpriteFrame(32, -24, 80, 50, 0, 0)131132SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")133end event134135136