using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour 
{
	public float movementSpeed = 3;
	public bool smoothMove;
	public bool forward;

	public float horizontalValue;
	public float verticalValue;

	void Start () 
	{
		
	}

	void Update () 
	{
		horizontalValue = GetHorizontalMove() * movementSpeed;
		verticalValue = Input.GetAxis (Buttons.MoveV) * movementSpeed;

		if(smoothMove)
		{
			horizontalValue *= Time.deltaTime;
			verticalValue *= Time.deltaTime;
		}
	}

	float GetHorizontalMove ()
	{
		float returnValue = Input.GetAxis (Buttons.MoveH);
		if(forward)
		{
			if(returnValue > 0)
			{
				return returnValue;
			}
			else
			{
				return 0;
			}
		}

		return returnValue;
	}
}
