mirror of
https://github.com/ConjureETS/MeltedBananasOJam2016.git
synced 2026-03-24 02:21:06 +00:00
Mouvement du joueur
This commit is contained in:
parent
a6d4f21ce9
commit
89d6023b21
23
Assets/Scripts/PlayerMovement.cs
Normal file
23
Assets/Scripts/PlayerMovement.cs
Normal file
@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user