Add player health system
This commit is contained in:
@@ -2,16 +2,16 @@ using UnityEngine;
|
||||
|
||||
public class Teo : MonoBehaviour
|
||||
{
|
||||
public float health = 100F;
|
||||
public float moveSpeed = 10F;
|
||||
Rigidbody2D controller;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
void Start() {
|
||||
controller = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Rigidbody2D controller = GetComponent<Rigidbody2D>();
|
||||
void Update() {
|
||||
controller.linearVelocity = new Vector2 (
|
||||
Input.GetAxis("Horizontal"),
|
||||
Input.GetAxis("Vertical")
|
||||
|
||||
Reference in New Issue
Block a user