private void CoinBodyEntered(object body) { if (body.GetType().Name == "Orange") { animationPlayer.Play("CoinBounce"); coinCollision.QueueFree(); audioPlayer.Play(); timer.Start(); EmitSignal("CoinCollected"); } }
public void Hit() { if (hasExploded) { return; } hasExploded = true; animation.Play("Explode"); audio.Play(); sprite.QueueFree(); collisionShape.QueueFree(); timer.Start(); }