using UnityEngine;
using System.Collections;
public class MoveMaze : MonoBehaviour {
public Transform ballObj;
// Use this for initialization
void Start () {
public Rigidbody2D myScriptsRigidbody2D;
}
// Update is called once per frame
void Update () {
if (Input.GetKey ("w"))
{
myScriptsRigidbody2D = GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, -3);
ballObj.transform.eulerAngles = new Vector3 (0, 0, 0);
}
else
if (Input.GetKey ("s"))
{
myScriptsRigidbody2D = Getcomponent<Rigidbody2D> ().velocity = new Vector2 (0, 3);
ballObj.transform.eulerAngles = new Vector3 (0, 0, 180);
}
else
if (Input.GetKey ("a"))
{
myScriptsRigidbody2D = Getcomponent<Rigidbody2D> ().velocity = new Vector2 (3, 0);
ballObj.transform.eulerAngles = new Vector3 (0, 0, 90);
}
else
if (Input.GetKey ("d"))
{
myScriptsRigidbody2D = Getcomponent<Rigidbody2D> ().velocity = new Vector2 (-3, 0);
ballObj.transform.eulerAngles = new Vector3 (0, 0, -90);
}
else
{
myScriptsRigidbody2D = Getcomponent<Rigidbody2D> ().velocity = new Vector2 (0, 0);
}
}
}