added some more signals for attack hit, enemy and player controllers turn done, commander enemy death, better enemy movement and turn changing, implemented an rng, added functions to grid and gridmarkers to allow for easier searching of markers, more logic for if a tower commander has actions
This commit is contained in:
@@ -14,31 +14,31 @@ public partial class Tower : Sprite2D
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
base._Process(delta);
|
||||
|
||||
if (Input.IsActionJustPressed("leftClick"))
|
||||
if (_commander?._actions > 0)
|
||||
{
|
||||
if (_hovered)
|
||||
if (Input.IsActionJustPressed("leftClick"))
|
||||
{
|
||||
_aiming = true;
|
||||
_commander.LoadAttack();
|
||||
if (_hovered)
|
||||
{
|
||||
_aiming = true;
|
||||
_commander.LoadAttack();
|
||||
}
|
||||
}
|
||||
if (_aiming)
|
||||
{
|
||||
if (Input.IsActionJustReleased("rightClick"))
|
||||
{
|
||||
Vector2 offset = (GlobalPosition - GetGlobalMousePosition()) * 500;
|
||||
_commander.ShootCurrentAttack(offset);
|
||||
_aiming = false;
|
||||
}
|
||||
else if (Input.IsActionJustReleased("leftClick"))
|
||||
{
|
||||
_commander.UnloadAttack();
|
||||
_aiming = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_aiming)
|
||||
{
|
||||
if (Input.IsActionJustReleased("rightClick"))
|
||||
{
|
||||
Vector2 offset = (GlobalPosition - GetGlobalMousePosition()) * 500;
|
||||
_commander.ShootCurrentAttack(offset);
|
||||
_aiming = false;
|
||||
}
|
||||
else if (Input.IsActionJustReleased("leftClick"))
|
||||
{
|
||||
_commander.UnloadAttack();
|
||||
_aiming = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void OnMouseEntered(){
|
||||
|
||||
Reference in New Issue
Block a user