second commit
This commit is contained in:
@@ -3,7 +3,9 @@ using Godot;
|
||||
public partial class Attack : RigidBody2D
|
||||
{
|
||||
public bool _hovered = false;
|
||||
public int _damage = 1;
|
||||
public Vector2 _speed;
|
||||
public Player _playerOwner;
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
@@ -18,12 +20,19 @@ public partial class Attack : RigidBody2D
|
||||
_speed = FORCE;
|
||||
GravityScale = 1;
|
||||
}
|
||||
|
||||
public void TakeAction(Node BODY)
|
||||
{
|
||||
if (BODY is Enemy enemy)
|
||||
{
|
||||
enemy.TakeDamage(_damage, _playerOwner);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnMouseEntered(){
|
||||
GD.Print("Hovered");
|
||||
_hovered = true;
|
||||
}
|
||||
public void OnMouseExited(){
|
||||
GD.Print("Not Hovered");
|
||||
_hovered = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user