Added counter script to count ducks (and other things)
This commit is contained in:
@@ -13,6 +13,7 @@ public partial class MVPDuck : Node2D
|
||||
[Export] private AnimationPlayer _animationPlayer;
|
||||
[Export] private string _flapAnimationName = "flapFlap";
|
||||
|
||||
[Signal] public delegate void DuckCollectedEventHandler();
|
||||
|
||||
public void TransferToTargetAfterDelay()
|
||||
{
|
||||
@@ -29,7 +30,8 @@ public partial class MVPDuck : Node2D
|
||||
public async void MoveAfterDelay()
|
||||
{
|
||||
await ToSignal(GetTree().CreateTimer(1.0f), "timeout"); // 1.0f seconds
|
||||
Position = _penTarget.GlobalPosition; // Now this works!
|
||||
Position = _penTarget.GlobalPosition;
|
||||
EmitSignal(SignalName.DuckCollected);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user