first commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user