Add player health system

This commit is contained in:
2024-10-19 19:02:56 -07:00
parent de624d838f
commit 643070aefb
88 changed files with 61848 additions and 187 deletions

View File

@@ -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")