| @@ -0,0 +1,33 @@ | ||
| using UnityEngine; | ||
| using System.Collections; | ||
|
|
||
| public class HiveMovement : MonoBehaviour | ||
| { | ||
| public float speed = 0.2f; | ||
| // Use this for initialization | ||
| void Start () | ||
| { | ||
|
|
||
| } | ||
|
|
||
| // Update is called once per frame | ||
| void Update () | ||
| { | ||
| if(Input.GetKey(KeyCode.A)) | ||
| { | ||
| transform.position = new Vector3(transform.position.x - speed, transform.position.y, transform.position.z); | ||
| } | ||
| if (Input.GetKey(KeyCode.D)) | ||
| { | ||
| transform.position = new Vector3(transform.position.x + speed, transform.position.y, transform.position.z); | ||
| } | ||
| if (Input.GetKey(KeyCode.W)) | ||
| { | ||
| transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z + speed); | ||
| } | ||
| if (Input.GetKey(KeyCode.S)) | ||
| { | ||
| transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z - speed); | ||
| } | ||
| } | ||
| } |