// ----------------------------------
// RSDK Project: Sonic 2
// Script Description: Object Score Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// ========================
// Aliases
// ========================

private alias object.value0 : object.timer


// ========================
// Events
// ========================

event ObjectUpdate
	// Move the object up by 2 pixels
	object.ypos -= 0x20000
	
	// Unload when needed
	object.timer++
	if object.timer == 24
		object.type = TypeName[Blank Object]
	end if
end event


event ObjectDraw
#platform: USE_ORIGINS
	if game.playMode == BOOT_PLAYMODE_MIRRORING
		object.direction = FLIP_X
		DrawSpriteFX(object.propertyValue, FX_FLIP, object.xpos, object.ypos)
	else
		DrawSprite(object.propertyValue)
	end if
#endplatform
#platform: USE_STANDALONE
	DrawSprite(object.propertyValue)
#endplatform
end event


event ObjectStartup
	LoadSpriteSheet("Global/Display.gif")

	// Score frames
	SpriteFrame(-8, 0, 16, 10, 66, 53)
	SpriteFrame(-8, 0, 16, 10, 123, 35)
	SpriteFrame(-8, 0, 16, 10, 140, 35)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-10, 0, 21, 10, 66, 53)
	SpriteFrame(-13, 0, 26, 10, 66, 53)
	SpriteFrame(-6, 0, 11, 10, 66, 53)
end event


// ========================
// Editor Events
// ========================

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-8, 0, 16, 10, 66, 53)
	
	// used in-game, but this shouldn't be placed down in the scene so it doesn't matter
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
