Add death animation

This commit is contained in:
RochesterX
2025-03-07 10:46:30 -05:00
parent 6528d1050f
commit c36f3b5a1a
8 changed files with 4000 additions and 230 deletions

View File

@@ -1,9 +1,7 @@
using System.Collections;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Tilemaps;
[RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(BoxCollider2D))]
@@ -40,6 +38,7 @@ public class PlayerMovement : MonoBehaviour
private PlayerInput input;
private AnimationPlayer animationPlayer;
private Punch punch;
private Damageable damageable;
private bool jumpInputStillValid = false;
private float lastTimeJumpPressed;
@@ -64,12 +63,15 @@ public class PlayerMovement : MonoBehaviour
input = GetComponent<PlayerInput>();
animationPlayer = GetComponent<AnimationPlayer>();
punch = GetComponent<Punch>();
damageable = GetComponent<Damageable>();
playerText.text = input.playerIndex.ToString();
}
private void Update()
{
if (damageable.dying) return;
Jump();
UpdateVirtualAxis();