using UnityEngine;
using System.Collections;

public class fireFrame1 : MonoBehaviour {
	private float xpos;
	public float ypos;
	// Use this for initialization
	void Start () {
		xpos = -363f;
	}
	
	// Update is called once per frame
	void Update () {
		if (xpos < 350f) {
			transform.position = new Vector2 (xpos, ypos);
			xpos += 5f;
		} else
			xpos = -363f;
	}
	void OnCollisionEnter2D(Collision2D other){
		if (other.gameObject.tag == "Player") {
			Destroy (other.gameObject);
			Application.LoadLevel ("level");
		}
	}
}
