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

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

event ObjectUpdate
	object.xvel = EndingSetup_scrollVelocity.x
	object.xvel *= object.drawOrder
	object.xpos += object.xvel

	object.yvel = EndingSetup_scrollVelocity.y
	object.yvel *= object.drawOrder
	object.ypos += object.yvel
end event


event ObjectDraw
	DrawSprite(object.frame)
end event


event ObjectStartup
	LoadSpriteSheet("Ending/Objects.gif")

	// Cloud Frames
	SpriteFrame(-8, -4, 16, 8, 355, 165)
	SpriteFrame(-24, -4, 48, 8, 306, 165)
	SpriteFrame(-40, -4, 79, 8, 306, 156)
end event


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

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("Ending/Objects.gif")
	SpriteFrame(-40, -4, 79, 8, 306, 156) // Using biggest cloud as preview frame

	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
