using UnityEngine;
using System.Collections;

public class Gameplay : MonoBehaviour {

	public GameObject foodbit;
	public CharacterMotor chara;
	public int power;

	private int p_power = 0;
	public GUIText pgui;
	private ArrayList pill = new ArrayList();

	// Use this for initialization
	void Start () {
		power = 99999;

		for (int i = 0; i < 10;i++){
			Vector3 position = new Vector3(Random.Range(-3, 3), Random.Range(0, 3), Random.Range(-3, 3));
			pill.Add(Instantiate(foodbit, position, Quaternion.identity));
		}
	}

	// Update is called once per frame
	void Update () {
		if (chara.IsJumping()) power--;

		if (power != p_power) {
			pgui.text = "Power: " + power;
			p_power = power;
		}
	}
}
