using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

    bool moveUp;

    float upPoint;
    float downPoint;

    float midPoint;

    bool combat;

    public bool Combat
    {
        get
        {
            return combat;
        }

        set
        {
            combat = value;
        }
    }

    void Awake()
    {
        combat = false;

        midPoint = transform.position.y;

        //MID POINT -6.2f

        upPoint = midPoint + 0.3f;
        downPoint = midPoint - 0.3f;

        moveUp = true;
    }

    // Update is called once per frame
    void Update () {
        if(!combat)
            DungeonMove();
	}

    public void DungeonMove()
    {
        if (moveUp)
        {
            transform.position += new Vector3(0, .01f, 0);

            if (transform.position.y >= upPoint)
                moveUp = false;
        }
        else
        {
            transform.position -= new Vector3(0, .01f, 0);

            if (transform.position.y <= downPoint)
                moveUp = true;
        }
    }
}
