mirror of
https://github.com/ConjureETS/MeltedBananasOJam2016.git
synced 2026-03-24 10:31:07 +00:00
24 lines
708 B
C#
24 lines
708 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class PlayerMovement : MonoBehaviour {
|
|
|
|
public float speed = 0f;
|
|
public float turn = 0f;
|
|
//private Rigidbody rb;
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
if (Input.GetKey(KeyCode.UpArrow))
|
|
transform.Translate(Vector3.forward * speed * Time.deltaTime);
|
|
if (Input.GetKey(KeyCode.DownArrow))
|
|
transform.Translate(-Vector3.forward * speed * Time.deltaTime);
|
|
if (Input.GetKey(KeyCode.LeftArrow))
|
|
transform.Rotate(Vector3.up, -turn * Time.deltaTime);
|
|
if (Input.GetKey(KeyCode.RightArrow))
|
|
transform.Rotate(Vector3.up, turn * Time.deltaTime);
|
|
}
|
|
}
|