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

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

private alias object.value18 : player.sortedDrawOrder


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

event ObjectUpdate
	object.drawOrder = player[0].sortedDrawOrder
	
	object.xpos += object.xvel
	object.ypos += object.yvel

	object.frame++
	if object.frame >= 3
		object.frame = 0
	end if

	object.animationTimer++
	if object.animationTimer >= 22
		object.type = TypeName[Blank Object]
	end if
end event


event ObjectDraw
	DrawSpriteFX(object.frame, FX_FLIP, object.xpos, object.ypos)
end event


event ObjectStartup
	LoadSpriteSheet("Global/Items3.gif")
	SpriteFrame(0, 0, 1, 1, 1, 1)
	SpriteFrame(-3, -3, 6, 6, 150, 84)
	SpriteFrame(-8, -8, 16, 16, 157, 84)
end event


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

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("Global/Items3.gif")
	SpriteFrame(-8, -8, 16, 16, 157, 84)
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
