using UnityEngine;
using System.Collections;

public class LightSwitch : Item {
	void Action(){
		StartCoroutine (Switched ());
	}
	IEnumerator Switched(){
		audio.Play ();
		room.player.rigidbody2D.velocity = Vector2.zero;
		Destroy(room.player);
		room.SendMessage ("ShowMessage","Switching on the light woke your parents up. You're grounded again.");
		yield return new WaitForSeconds(room.msgTime +room.msgFadeTime);
		gc.Penalty (20f);
		gc.SendMessage ("ClearTeenItems");
		Application.LoadLevel("TeenBedroom");
	}
}
