
using UnityEngine;

public class PlayerMovement : MonoBehaviour {

    public Rigidbody2D rb;
    public float xSpeed = 5;
    public float ySpeed = 5;
    Vector2 p1MovementVector;


	
	// Update is called once per frame
	void Update ()
    {
		 p1MovementVector = new Vector2 ((Input.GetAxisRaw("P1Horizontal")), Input.GetAxisRaw("P1Vertical"));
         
    }

    void FixedUpdate()
    {
        p1MovementVector = new Vector2(p1MovementVector.x * xSpeed, p1MovementVector.y * ySpeed);
        rb.AddForce(p1MovementVector);
    }
}
