ObjectData = 
{
MotionModel = 
	{
		DefaultAnimation = [[blank]],
		Motions = 
		{
			motion2 = 
			{
				Animations = 
				{
					anim1 = 
					{
						Path = [[DATA:Animations\Platforms\emotion_platform_happy_toolbar.anim]],
						Name = [[emotion_platform_happy_toolbar]],
						MinFreq = 1.000000,
						MaxFreq = 1.000000,
					},
				},
				Name = [[toolbar]],
			},
			motion1 = 
			{
				Animations = 
				{
					anim1 = 
					{
						Path = [[DATA:Animations\Platforms\blank.anim]],
						Name = [[blank]],
						MinFreq = 1.000000,
						MaxFreq = 1.000000,
					},
				},
				Name = [[blank]],
			},
			motion3 = 
			{
				Animations = 
				{
					anim1 = 
					{
						Path = [[DATA:Animations\Platforms\emotion_platform_happy_inactive.anim]],
						Name = [[emotion_platform_happy_inactive]],
						MinFreq = 1.000000,
						MaxFreq = 1.000000,
					},
				},
				Name = [[emotion_platform_happy_inactive]],
			},
		},
	},
	Extensions = 
	{
		PhysicsExtension = 
		{
			mass = 0.000000,
			static_friction = 0.000000,
			kinetic_friction = 0.000000,
		},
		PlatformExtension =
		{
			breakable = false,
		},
		WalkableExtension = 
		{
		},
		FlippableExtension = 
		{
		},
		LevelEditorExtension = 
		{
			locked = false,
			rotate_divisions = 32.000000,
		},
		PositionExtension = 
		{
			background = true,
		},
		EmotionPlatformExtension =
		{
			current_emotion = 0
		}
	},
}

-- Begin Scripting --

help_text_header = "$00621"
help_text = "$00622"

function OnInit()

	this:EnablePhysics( false )	

end


function Update()

	Profile_Start("emotion_platform_happy")

	CheckEmotion()
	
	Profile_Stop("emotion_platform_happy")
	
end

function CheckEmotion()

	local epe = this:GetEmotionPlatformExtension()
	
	if epe and epe:MatchesCurrentEmotion() then
	
		this:EnableCollisions( true )	
		
		local motion_model = this:GetMotionModel()
		motion_model:SetDefaultMotion("blank")
		
	else
	
		this:EnableCollisions( false )	
		
		local motion_model = this:GetMotionModel()
		motion_model:PushMotion("emotion_platform_happy_inactive", false, true)
		
	end

end

function OnCreatorUpdate()
	
end

