<?xml version="1.0" ?>

<Scene name="Bedroom_letter" image="Bedroom" music_volume_multiplier="0.3">

	<Audio source="chapter1"/>
	
	<!-- Scene layers, anims & sounds -->
	<Object type="ImageBox" image="scene_new_crest_placed" x="426" y="316" />
	<Object type="ImageBox" image="scene_new_picture" x="354" y="173" center_x="5" center_y="5" angle="-70"/>
	
	<if t="not $bedroom_key_taken">	<Object type="ImageBox" image="scene_new_key" x="506" y="215" /> </if>
	
	<if t="$letter_read == 1">
		<Object type="ImageBox" image="backgroundletter" alpha="100" x="0" y="62">
			<Animator type="AlphaChanger" amplitude="255" speed="0.1" />
		</Object>
		<Object type="ImageBox" image="scene_grandmas_letter" alpha="10" x="223" y="-80" scale_x="0.1" scale_y="0.1"> <!-- 216, 75 -->
 			<Animator type="ScalerX" amplitude="0.9" speed="2"/>
			<Animator type="ScalerY" amplitude="0.9" speed="2"/>
			<Animator type="MoverX" amplitude="75" speed="2"/>
			<Animator type="MoverY" amplitude="150" speed="2"/>
			<Animator type="AlphaChanger" amplitude="255" speed="2"/>
		</Object>
		<Animator type="DelayedAction" time="1">
			<Action type="UnlockScene"/>
		</Animator>
	</if>
	<if t="$letter_read == -1">
		<Action type="LockScene"/>
		<Object type="ImageBox" image="backgroundletter" alpha="255" x="0" y="62">
			<Animator type="AlphaChanger" amplitude="-255" speed="1" />
		</Object>
		<Object type="ImageBox" image="scene_grandmas_letter" x="316" y="75" >
			<Animator type="MoverY" amplitude="620" speed="2"/>
			<Animator type="Rotator" amplitude="50" speed="2"/>
			<Animator type="AlphaChanger" amplitude="-255" speed="1"/>
		</Object>
		<Animator type="DelayedAction" time="1.5">
			<Action type="SetVar" var="letter_read" value="2" reset="0"/>
			<Action type="SwitchScene" scene="Bedroom" effect="none"/>
			<Action type="UnlockScene"/>
		</Animator>
	</if>
	
	<!-- Actions -->
	<if t="$letter_read == 1">
		<Action color="0000FF" type="Reference" ref="M::exit_letter" sparkle="0"/>
		<Action color="FFFF00" type="Reference" ref="M::exit_letter" sparkle="0"/>
		<Action color="0000FF" type="Reference" ref="M::exit_letter" sparkle="0"/>
		<Action color="00FF00" type="Reference" ref="M::exit_letter" sparkle="0"/>
		<Action color="FF0000" type="Reference" ref="M::exit_letter" sparkle="0"/>

		<Action name="M::exit_letter" type="Composite">	
			<Action type="LockScene"/>						
			<Action type="PlaySound" sound="generic_item_use_put_taken"/>
			<Action type="StopSound" sound="grandmas_letter"/>
			<Action type="SetVar" var="letter_read" value="-1" reset="1"/>
		</Action>
		
		<Animator type="DelayedAction" time="1"> <Action type="PlaySound" sound="grandmas_letter"/> </Animator>
	</if>
	
	
	<!-- Other -->
	<!-- <Action condition="$prev_scene == arrival.Bedroom" type="UnlockScene"/> -->



</Scene>