Beispiel #1
0
 private void MakeMonsterRoom1()
 {
     Vector2 door1Camera = Room.TileToWorldPos(new Vector2(8.5f, 52.5f));
     Vector2 door2Camera = Room.TileToWorldPos(new Vector2(8.5f, 36.5f));
     MonsterRoom.CreateStartEvent createStart = (Room room, Player player) =>
     {
         List<CameraEvent> events = new List<CameraEvent>();
         events.Add(new CameraEvent(door1Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 52].puzzle).Close();
         }));
         events.Add(new CameraEvent(door2Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 36].puzzle).Close();
         }));
         return events;
     };
     Vector2 spawnEnemyCamera = (door1Camera + door2Camera) / 2f;
     MonsterRoom.CreateEnemiesEvent createEnemies = (Room room, Player player, List<Enemy> enemies) =>
     {
         Turret turret = new Turret(spawnEnemyCamera);
         turret.maxShootTimer = 75;
         enemies.Add(turret);
         enemies.Add(new Spider(spawnEnemyCamera - Room.TileToWorldPos(-4, -4)));
         enemies.Add(new Spider(spawnEnemyCamera - Room.TileToWorldPos(-5, 0)));
         enemies.Add(new Spider(spawnEnemyCamera - Room.TileToWorldPos(-4, 4)));
         enemies.Add(new Spider(spawnEnemyCamera - Room.TileToWorldPos(4, -4)));
         enemies.Add(new Spider(spawnEnemyCamera - Room.TileToWorldPos(5, 0)));
         enemies.Add(new Spider(spawnEnemyCamera - Room.TileToWorldPos(4, 4)));
     };
     MonsterRoom.CreateEndEvent createEnd = (Room room, Player player) =>
     {
         List<CameraEvent> events = new List<CameraEvent>();
         events.Add(new CameraEvent(door1Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 52].puzzle).Open();
         }));
         events.Add(new CameraEvent(door2Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 36].puzzle).Open();
         }));
         return events;
     };
     monsterRoom1 = new MonsterRoom(topRight, createStart, spawnEnemyCamera, createEnemies, createEnd);
 }
Beispiel #2
0
 private void MakeMonsterRoom3()
 {
     Vector2 door1Camera = Room.TileToWorldPos(new Vector2(8.5f, 20.5f));
     Vector2 door2Camera = Room.TileToWorldPos(new Vector2(8.5f, 4.5f));
     MonsterRoom.CreateStartEvent createStart = (Room room, Player player) =>
     {
         List<CameraEvent> events = new List<CameraEvent>();
         events.Add(new CameraEvent(door1Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 20].puzzle).Close();
         }));
         events.Add(new CameraEvent(door2Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 4].puzzle).Close();
         }));
         return events;
     };
     Vector2 spawnEnemyCamera = (door1Camera + door2Camera) / 2f;
     MonsterRoom.CreateEnemiesEvent createEnemies = (Room room, Player player, List<Enemy> enemies) =>
     {
         Turret turret = new Turret(spawnEnemyCamera);
         turret.maxShootTimer = 120;
         enemies.Add(turret);
         enemies.Add(new Spider(spawnEnemyCamera + Room.TileToWorldPos(-5, 1)));
         enemies.Add(new Spider(spawnEnemyCamera + Room.TileToWorldPos(5, 1)));
         FireCaster caster = new FireCaster(spawnEnemyCamera + Room.TileToWorldPos(-2, -4));
         caster.maxShootTimer = 120;
         enemies.Add(caster);
         caster = new FireCaster(spawnEnemyCamera + Room.TileToWorldPos(2, -4));
         caster.maxShootTimer = 120;
         enemies.Add(caster);
     };
     MonsterRoom.CreateEndEvent createEnd = (Room room, Player player) =>
     {
         List<CameraEvent> events = new List<CameraEvent>();
         events.Add(new CameraEvent(door1Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 20].puzzle).Open();
         }));
         events.Add(new CameraEvent(door2Camera, (Room r, Player p, int time) =>
         {
             ((Door)room.tiles[8, 4].puzzle).Open();
         }));
         return events;
     };
     monsterRoom3 = new MonsterRoom(topRight, createStart, spawnEnemyCamera, createEnemies, createEnd);
 }
Beispiel #3
0
 private void CreateRoom4MonsterRoom()
 {
     Vector2 cameraTarget1 = Room.TileToWorldPos(new Vector2(10.5f, 20.5f));
     MonsterRoom.CreateStartEvent createStart = (Room room, Player player) =>
     {
         List<CameraEvent> events = new List<CameraEvent>();
         events.Add(new CameraEvent(cameraTarget1, (Room r, Player p, int time) =>
         {
             Door door = (Door)r.tiles[10, 20].puzzle;
             door.Close();
         }));
         return events;
     };
     Vector2 spawnEnemyCamera = Room.TileToWorldPos(new Vector2(10.5f, 10.5f));
     MonsterRoom.CreateEnemiesEvent createEnemies = (Room r, Player p, List<Enemy> enemies) =>
     {
         Turret turret = new Turret(Room.TileToWorldPos(new Vector2(5.5f, 7.5f)));
         turret.maxShootTimer = 90;
         enemies.Add(turret);
         turret = new Turret(Room.TileToWorldPos(new Vector2(15.5f, 7.5f)));
         turret.maxShootTimer = 90;
         enemies.Add(turret);
         enemies.Add(new Spider(Room.TileToWorldPos(new Vector2(5.5f, 13.5f))));
         enemies.Add(new Spider(Room.TileToWorldPos(new Vector2(15.5f, 13.5f))));
     };
     MonsterRoom.CreateEndEvent createEnd = (Room room, Player player) =>
     {
         List<CameraEvent> events = new List<CameraEvent>();
         events.Add(new CameraEvent(cameraTarget1, (Room r, Player p, int time) =>
         {
             Door door = (Door)r.tiles[10, 20].puzzle;
             door.Open();
         }));
         Vector2 camTarget = Room.TileToWorldPos(new Vector2(20.5f, 3.5f));
         events.Add(new CameraEvent(camTarget, (Room r, Player p, int time) =>
         {
             Door door = (Door)r.tiles[20, 3].puzzle;
             door.Open();
         }));
         return events;
     };
     room4MonsterRoom = new MonsterRoom(room4, createStart, spawnEnemyCamera, createEnemies, createEnd);
 }