private void OnEnemyKilled(Enemy enemy, Player killedBy) { enemy.OnKilled(killedBy); }
private Tile LoadStartTile(int x, int y) { if (this.Player != null) { throw new NotSupportedException("level may only have one starting point."); } this.start = RectangleExtensions.GetBottomCenter(GetBounds(x, y)); //Set player this.player = new Player(this, start); return new Tile(null, TileCollision.Passable); }
private void OnGemCollected(Gem gem, Player collectedBy) { this.score += GlobalConstants.GemPointValue; gem.OnCollected(collectedBy); }
public void OnKilled(Player killedBy) { this.IsAlive = false; this.killedSound.Play(); // once player is dead, play the killed sound for enemy }