starting to work on enemy attacks and player health
This commit is contained in:
+1
-12
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user