public static void Throw(Room room, int x, int y, Vector2 velocity) { if (((Boulder)room.tiles[x, y].puzzle).bottom) { y--; } if (((Boulder)room.tiles[x, y].puzzle).right) { x--; } room.RemovePuzzle(x, y); room.RemovePuzzle(x + 1, y); room.RemovePuzzle(x, y + 1); room.RemovePuzzle(x + 1, y + 1); room.bullets.Add(new ThrownBoulder(Room.TileToWorldPos(x + 1, y + 1), velocity)); }
public override void OnPlayerCollide(Room room, int x, int y, Player player) { Vector2 pos = Tile.tileSize * new Vector2(x + 0.5f, y + 0.5f); if (Math.Abs(player.position.X - pos.X) <= (Player.size + width) / 2f && Math.Abs(player.position.Y - pos.Y) <= (Player.size + height) / 2f) { player.silverKeys++; room.RemovePuzzle(x, y); } }
private void Win(Enemy enemy, Room room, Player player) { room.bullets.Clear(); for (int x = 0; x < room.width; x++) { for (int y = 0; y < room.height; y++) { room.RemovePuzzle(x, y); } } player.exp++; room.AddPuzzle(room.width / 2, room.height / 2, new Goal("Fire Dungeon", Color.Brown)); }