/** * We used a delegate for the collision with the coin, because it currently * isn't possible to return a coin in the CollisionDetecter. **/ private void OnCoinCollision(object sender, ImmovableEventArgs args) { args.Coin.State = false; _gameView.GameCanvas.Children.Remove(args.Coin.Image); //Remove coin from canvas _score.ScoreValue += 10; }
protected virtual void OnCoinCollision(ImmovableEventArgs args) { CoinCollision?.Invoke(this, args); }
public void OnCoinCollision(object sender, ImmovableEventArgs args) { _soundPlayer.Stream = Resources.pacman_chomp; _soundPlayer.Play(); }