third commit
This commit is contained in:
@@ -5,7 +5,7 @@ public partial class Attack : RigidBody2D
|
||||
public bool _hovered = false;
|
||||
public int _damage = 1;
|
||||
public Vector2 _speed;
|
||||
public Player _playerOwner;
|
||||
public Commander _commanderOwner;
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
@@ -23,9 +23,11 @@ public partial class Attack : RigidBody2D
|
||||
|
||||
public void TakeAction(Node BODY)
|
||||
{
|
||||
GD.Print("Body Entered");
|
||||
if (BODY is Enemy enemy)
|
||||
{
|
||||
enemy.TakeDamage(_damage, _playerOwner);
|
||||
GD.Print("Body Entered is enemy");
|
||||
enemy.TakeDamage(_damage, _commanderOwner);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user