starting to work on enemy attacks and player health

This commit is contained in:
2026-06-12 02:03:17 -04:00
parent 9f75ec525c
commit 1903e1a1aa
5 changed files with 37 additions and 24 deletions
+1 -12
View File
@@ -3,11 +3,9 @@ using System;
public partial class Commander : Sprite2D
{
[Signal]
public delegate void DeathEventHandler(Commander THIS);
[Signal]
public delegate void ActionsUpEventHandler();
public int _health = 10, _actionsMax = 1, _actions;
public int _actionsMax = 1, _actions;
public PackedScene _attackScene = GD.Load<PackedScene>("res://Attack.tscn");
public Attack _attack;
public PlayerController _playerController;
@@ -47,15 +45,6 @@ public partial class Commander : Sprite2D
}
}
public void TakeDamage(int DAMAGE, Enemy ATTACKER)
{
_health -= DAMAGE;
if (_health <= 0)
{
EmitSignal(SignalName.Death, this);
}
}
public void ShootCurrentAttack(Vector2 FORCE){
_attack.Shoot(FORCE);