using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
Rigidbody r=new Rigidbody();
float rotationSpeed;
Vector3 jumpHeight;
void setRotationSpeed(float speed){
rotationSpeed = speed;
}
Vector3 getJumpHeight(){
return jumpHeight;
}
void setJumpHeight(float x,float y,float z){
jumpHeight = new Vector3 (x, y, z);
}
// Use this for initialization
void Start () {
setRotationSpeed (20);
setJumpHeight (0.0f,5,0.0f);
r = GetComponent<Rigidbody> ();
}
// Update is called once per frame
void Update () {
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVeritcal = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVeritcal);
r.AddForce(movement*rotationSpeed);
if (Input.GetButtonDown ("Jump")) {
r.velocity=jumpHeight;
}
}
}