|
|
|
@ -15,10 +15,10 @@ public partial class VesnaAnimations : Node
|
|
|
|
private int _toolID = -1; // -1 means no tool.
|
|
|
|
private int _toolID = -1; // -1 means no tool.
|
|
|
|
private Vector2 _lastDirection = Vector2.Zero;
|
|
|
|
private Vector2 _lastDirection = Vector2.Zero;
|
|
|
|
|
|
|
|
|
|
|
|
[Signal] public delegate void LookingRightEventHandler();
|
|
|
|
/// <summary>
|
|
|
|
[Signal] public delegate void LookingLeftEventHandler();
|
|
|
|
/// Emits the last look direction of the player to other scripts.
|
|
|
|
[Signal] public delegate void LookingUpEventHandler();
|
|
|
|
/// </summary>
|
|
|
|
[Signal] public delegate void LookingDownEventHandler();
|
|
|
|
[Signal] public delegate void LookDirectionEventHandler(Vector2 direction);
|
|
|
|
|
|
|
|
|
|
|
|
public override void _Ready()
|
|
|
|
public override void _Ready()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -49,7 +49,6 @@ public partial class VesnaAnimations : Node
|
|
|
|
_sprite.Animation = "back walking" + _toolString;
|
|
|
|
_sprite.Animation = "back walking" + _toolString;
|
|
|
|
anyActionPressed = true;
|
|
|
|
anyActionPressed = true;
|
|
|
|
_lastDirection = Vector2.Up;
|
|
|
|
_lastDirection = Vector2.Up;
|
|
|
|
EmitSignal(SignalName.LookingUp);
|
|
|
|
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -58,7 +57,6 @@ public partial class VesnaAnimations : Node
|
|
|
|
_sprite.Animation = "front walking" + _toolString;
|
|
|
|
_sprite.Animation = "front walking" + _toolString;
|
|
|
|
anyActionPressed = true;
|
|
|
|
anyActionPressed = true;
|
|
|
|
_lastDirection = Vector2.Down;
|
|
|
|
_lastDirection = Vector2.Down;
|
|
|
|
EmitSignal(SignalName.LookingDown);
|
|
|
|
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -68,7 +66,6 @@ public partial class VesnaAnimations : Node
|
|
|
|
_sprite.Animation = "side walking" + _toolString;
|
|
|
|
_sprite.Animation = "side walking" + _toolString;
|
|
|
|
anyActionPressed = true;
|
|
|
|
anyActionPressed = true;
|
|
|
|
_lastDirection = Vector2.Right;
|
|
|
|
_lastDirection = Vector2.Right;
|
|
|
|
EmitSignal(SignalName.LookingRight);
|
|
|
|
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -78,7 +75,6 @@ public partial class VesnaAnimations : Node
|
|
|
|
_sprite.Animation = "side walking" + _toolString;
|
|
|
|
_sprite.Animation = "side walking" + _toolString;
|
|
|
|
anyActionPressed = true;
|
|
|
|
anyActionPressed = true;
|
|
|
|
_lastDirection = Vector2.Left;
|
|
|
|
_lastDirection = Vector2.Left;
|
|
|
|
EmitSignal(SignalName.LookingLeft);
|
|
|
|
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
walkingAnimationPicked = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -98,6 +94,8 @@ public partial class VesnaAnimations : Node
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmitSignal(SignalName.LookDirection, _lastDirection);
|
|
|
|
|
|
|
|
|
|
|
|
if (anyActionPressed)
|
|
|
|
if (anyActionPressed)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_sprite.Play();
|
|
|
|
_sprite.Play();
|
|
|
|
|