30 lines
633 B
C#
30 lines
633 B
C#
using Godot;
|
|
|
|
public partial class Attack : RigidBody2D
|
|
{
|
|
public bool _hovered = false;
|
|
public Vector2 _speed;
|
|
|
|
public override void _PhysicsProcess(double delta)
|
|
{
|
|
base._PhysicsProcess(delta);
|
|
if (_speed != Vector2.Zero){
|
|
ApplyCentralForce(_speed);
|
|
_speed = Vector2.Zero;
|
|
}
|
|
}
|
|
|
|
public void Shoot(Vector2 FORCE){
|
|
_speed = FORCE;
|
|
GravityScale = 1;
|
|
}
|
|
public void OnMouseEntered(){
|
|
GD.Print("Hovered");
|
|
_hovered = true;
|
|
}
|
|
public void OnMouseExited(){
|
|
GD.Print("Not Hovered");
|
|
_hovered = true;
|
|
}
|
|
}
|