Example #1
0
 public static void Draw(SpriteBatch spriteBatch)
 {
     AnimatedSpritesManager.animatedSpritesRoomManagers[(int)currentRoom].DrawOnTheBack(spriteBatch);
     TorchManager.Draw(spriteBatch);
     PlatformsManager.platformsRoomManagers[(int)currentRoom].Draw(spriteBatch);
     if (currentRoom == Rooms.finalBoss)
     {
         FinalBoss.Draw(spriteBatch);
     }
     else if (currentRoom == Rooms.midBoss)
     {
         MidBoss.Draw(spriteBatch);
     }
     EnemyManager.enemyRoomManagers[(int)currentRoom].Draw(spriteBatch);
     CollectablesManager.collectablesRoomManagers[(int)currentRoom].Draw(spriteBatch);
     ProjectilesManager.Draw(spriteBatch);
     Player.Draw(spriteBatch);
     MapsManager.maps[(int)currentRoom].Draw(spriteBatch);
     DoorsManager.doorsRoomManagers[(int)currentRoom].Draw(spriteBatch);
     AnimatedSpritesManager.animatedSpritesRoomManagers[(int)currentRoom].DrawInFront(spriteBatch);
     FireBallsManager.Draw(spriteBatch);
     LavaGeyserManager.Draw(spriteBatch);
     MonologuesManager.monologuesRoomManagers[(int)currentRoom].Draw(spriteBatch);
 }
Example #2
0
 public static void Update(float elapsedTime)
 {
     if (switchRoom())
         LoadSaveManager.SaveGameProgress();
     CameraManager.Update(elapsedTime);
     MapsManager.maps[(int)currentRoom].Update(elapsedTime);
     if (currentRoom== Rooms.finalBoss)
     {
         FinalBoss.Update(elapsedTime);
     }
     if(currentRoom==Rooms.midBoss)
     {
        MidBoss.Update(elapsedTime);
     }
     EnemyManager.enemyRoomManagers[(int)currentRoom].Update(elapsedTime);
     FireBallsManager.Update(elapsedTime);
     LavaGeyserManager.Update(elapsedTime);
     PlatformsManager.platformsRoomManagers[(int)currentRoom].Update(elapsedTime);
     CollectablesManager.collectablesRoomManagers[(int)currentRoom].Update(elapsedTime);
     MonologuesManager.monologuesRoomManagers[(int)currentRoom].Update(elapsedTime);
     DoorsManager.doorsRoomManagers[(int)currentRoom].Update();
     AnimatedSpritesManager.animatedSpritesRoomManagers[(int)currentRoom].Update(elapsedTime);
     TorchManager.Update(elapsedTime);
 }
Example #3
0
        //trigger the specified event
        public static void TriggerEvent(Events _event)
        {
            if (RoomsManager.CurrentRoom == RoomsManager.Rooms.tutorial0)
            {
                switch (_event)
                {
                case Events.introMonologue:
                    MonologuesManager.monologuesRoomManagers[(int)RoomsManager.CurrentRoom].PlayMonologue(0);
                    happening             = Events.introMonologue;
                    elapsedEventsDuration = 0;
                    break;

                case Events.finalMonologue:
                    MonologuesManager.monologuesRoomManagers[(int)RoomsManager.CurrentRoom].PlayMonologue(1);
                    happening             = Events.finalMonologue;
                    elapsedEventsDuration = 0;
                    break;

                case Events.finalCutscene:
                    Game1.currentGameState = Game1.GameStates.ending;
                    CutscenesManager.cutscenes[1].ChangeSentence
                        (CutscenesManager.cutscenes[1].GetNUmOfSentences() - 1, "Your Time: " + GameStats.GetTimeString() +
                        "                                                                                            ");
                    happening             = Events.finalCutscene;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.tutorial3)
            {
                switch (_event)
                {
                case Events.keySpawns1_tutorial3:
                    CollectablesManager.collectablesRoomManagers[(int)RoomsManager.CurrentRoom].AddCollectableToMap(
                        new Collectable(new Point(350, 132), Collectable.ItemType.brassKey));
                    happening             = Events.keySpawns1_tutorial3;
                    elapsedEventsDuration = 0;
                    break;

                case Events.key1Collected_tutorial3:
                    eventAlreadyHappened[(int)Events.key1Collected_tutorial3] = true;
                    break;

                case Events.keySpawns2_tutorial3:
                    CollectablesManager.collectablesRoomManagers[(int)RoomsManager.CurrentRoom].AddCollectableToMap(
                        new Collectable(new Point(350, 46), Collectable.ItemType.silverKey));
                    happening             = Events.keySpawns2_tutorial3;
                    elapsedEventsDuration = 0;
                    break;

                case Events.key2Collected_tutorial3:
                    eventAlreadyHappened[(int)Events.key2Collected_tutorial3] = true;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.churchBellTower0)
            {
                switch (_event)
                {
                case Events.unlockDoubleJump:
                    Player.doubleJumpUnlocked = true;
                    AnimatedSpritesManager.animatedSpritesRoomManagers[(int)RoomsManager.CurrentRoom].AddTempAnimatedSprite(
                        new AnimatedSprite(new Vector2(211, 926), AnimatedSprite.AnimationType.displayDoubleJumpRelic, false));
                    happening             = Events.unlockDoubleJump;
                    elapsedEventsDuration = 0;
                    break;

                case Events.showDoubleJumpScreen:
                    Game1.currentGameState = Game1.GameStates.doubleJump;
                    happening             = Events.showDoubleJumpScreen;
                    elapsedEventsDuration = 0;
                    break;

                case Events.unlockWallJump:
                    Player.wallJumpUnlocked = true;
                    AnimatedSpritesManager.animatedSpritesRoomManagers[(int)RoomsManager.CurrentRoom].AddTempAnimatedSprite(
                        new AnimatedSprite(new Vector2(239, 926), AnimatedSprite.AnimationType.displayWallJumpRelic, false));
                    happening             = Events.unlockWallJump;
                    elapsedEventsDuration = 0;
                    break;

                case Events.showWallJumpScreen:
                    Game1.currentGameState = Game1.GameStates.wallJump;
                    happening             = Events.showWallJumpScreen;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.midBoss)
            {
                switch (_event)
                {
                case Events.keyAndPowerUpSpawn_midBoss:
                    CollectablesManager.collectablesRoomManagers[(int)RoomsManager.CurrentRoom].AddCollectableToMap(
                        new Collectable(new Point(280, 140), Collectable.ItemType.wallJump_powerup));
                    CollectablesManager.collectablesRoomManagers[(int)RoomsManager.CurrentRoom].AddCollectableToMap(
                        new Collectable(new Point(216, 148), Collectable.ItemType.brassKey));
                    happening             = Events.keyAndPowerUpSpawn_midBoss;
                    elapsedEventsDuration = 0;
                    break;

                case Events.pUpCollected_midBoss:
                    eventAlreadyHappened[(int)Events.pUpCollected_midBoss] = true;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.churchGroundFloor0)
            {
                switch (_event)
                {
                case Events.activateMovingPlatforms_churchGroundFloor0:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[16].active = true;
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[17].active = true;
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[18].active = true;
                    happening = Events.activateMovingPlatforms_churchGroundFloor0;
                    eventAlreadyHappened[(int)Events.resetMovingPlatforms_churchGroundFloor0] = false;
                    elapsedEventsDuration = 0;
                    break;

                case Events.resetMovingPlatforms_churchGroundFloor0:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[16].Reset(false);
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[17].Reset(false);
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[18].Reset(false);
                    happening = Events.resetMovingPlatforms_churchGroundFloor0;
                    eventAlreadyHappened[(int)Events.activateMovingPlatforms_churchGroundFloor0] = false;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.church1stFloor0)
            {
                switch (_event)
                {
                case Events.showInvisibleTiles_church1stFloor0:
                    List <AnimatedSprite> animatedSprites = new List <AnimatedSprite>();
                    for (int row = 0; row < MapsManager.maps[(int)RoomsManager.CurrentRoom].roomHeightTiles; row++)
                    {
                        for (int col = 0; col < MapsManager.maps[(int)RoomsManager.CurrentRoom].roomWidthTiles; col++)
                        {
                            if (MapsManager.maps[(int)RoomsManager.CurrentRoom].array[row, col].tileType == Tile.TileType.solidEmpty)
                            {
                                animatedSprites.Add(new AnimatedSprite(new Vector2(col * Tile.tileSize, row * Tile.tileSize),
                                                                       AnimatedSprite.AnimationType.invisibleTile));
                            }
                        }
                    }
                    AnimatedSpritesManager.animatedSpritesRoomManagers[(int)RoomsManager.CurrentRoom].AddAnimatedSprites(animatedSprites);
                    if (Player.position.X < 1032 && Player.position.X >= 1000)
                    {
                        CameraManager.MoveCamera(0, new Vector2(856, MapsManager.maps[(int)RoomsManager.CurrentRoom].RoomHeightPx), 8);
                    }
                    else if (Player.position.X < 684 && Player.position.X >= 664)
                    {
                        CameraManager.MoveCamera(0, new Vector2(528, MapsManager.maps[(int)RoomsManager.CurrentRoom].RoomHeightPx), 8);
                    }
                    else if (Player.position.X < 364 && Player.position.X >= 344)
                    {
                        CameraManager.MoveCamera(0, new Vector2(204, MapsManager.maps[(int)RoomsManager.CurrentRoom].RoomHeightPx), 8);
                    }
                    happening = Events.showInvisibleTiles_church1stFloor0;
                    eventAlreadyHappened[(int)Events.hide_InvisibleTiles_church1stFloor0] = false;
                    elapsedEventsDuration = 0;
                    break;

                case Events.hide_InvisibleTiles_church1stFloor0:
                    AnimatedSpritesManager.animatedSpritesRoomManagers[(int)RoomsManager.CurrentRoom].ClearAnimatedSprites();
                    CameraManager.MoveCamera(1, CameraManager.pointLocked, 8);
                    happening = Events.hide_InvisibleTiles_church1stFloor0;
                    eventAlreadyHappened[(int)Events.showInvisibleTiles_church1stFloor0] = false;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.churchAltarRoom)
            {
                switch (_event)
                {
                case Events.spawnKey_altar:
                    CollectablesManager.collectablesRoomManagers[(int)RoomsManager.CurrentRoom].AddCollectableToMap(
                        new Collectable(new Point(230, 400), Collectable.ItemType.silverKey));
                    eventAlreadyHappened[(int)Events.spawnKey_altar] = true;
                    break;

                case Events.keyCollected_altar:
                    eventAlreadyHappened[(int)Events.keyCollected_altar] = true;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.finalBoss)
            {
                switch (_event)
                {
                case Events.terrainCollapseFinalBoss:
                    List <int[]> tilesToRemove = new List <int[]>();
                    for (int col = 1; col < (MapsManager.maps[(int)RoomsManager.CurrentRoom].roomWidthTiles + 1) / 2; col++)
                    {
                        tilesToRemove.Add(new int[2] {
                            57, col
                        });
                        tilesToRemove.Add(new int[2] {
                            57, MapsManager.maps[(int)RoomsManager.CurrentRoom].roomWidthTiles - col - 1
                        });
                        tilesToRemove.Add(new int[2] {
                            56, col
                        });
                        tilesToRemove.Add(new int[2] {
                            56, MapsManager.maps[(int)RoomsManager.CurrentRoom].roomWidthTiles - col - 1
                        });
                    }
                    CollectablesManager.collectablesRoomManagers[(int)RoomsManager.CurrentRoom].RemoveCollectablesFromMap();
                    CameraManager.shakeForTime(eventsDuration[(int)Events.terrainCollapseFinalBoss]);
                    CameraManager.MoveCamera(0.3f, FinalBoss.fireballsCenter, 1);
                    MapsManager.maps[(int)RoomsManager.CurrentRoom].RemoveGroupOfTiles(tilesToRemove, 0.03f, 3);
                    happening             = Events.terrainCollapseFinalBoss;
                    elapsedEventsDuration = 0;
                    break;

                case Events.finalBossComesAlive:
                    CameraManager.shakeForTime(eventsDuration[(int)Events.finalBossComesAlive]);
                    FinalBoss.WakeUp();
                    happening             = Events.finalBossComesAlive;
                    elapsedEventsDuration = 0;
                    break;

                case Events.activatePlatformsFinalBoss:
                    for (int i = 0; i < 6; i++)
                    {
                        PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[i].active = true;
                    }
                    happening             = Events.activatePlatformsFinalBoss;
                    elapsedEventsDuration = 0;
                    break;

                case Events.escapeFinalBossRoom:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[6].active = true;
                    CameraManager.MoveCamera(1, FinalBoss.fireballsCenter, 1);
                    LavaGeyserManager.SweepAcross(2, 0.7f, 1, 0, 24, false);
                    happening             = Events.escapeFinalBossRoom;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.escape0)
            {
                switch (_event)
                {
                case Events.monologue_escape0:
                    MonologuesManager.monologuesRoomManagers[(int)RoomsManager.CurrentRoom].PlayMonologue(0);
                    happening             = Events.monologue_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lavaEruption1_escape0:
                    LavaGeyserManager.ShootGeyser(new float[] { MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 308 }, 0, -1000);
                    List <int[]> tilesToRemove = new List <int[]>();
                    for (int i = 0; i < 10; i++)
                    {
                        for (int j = 0; j < 3; j++)
                        {
                            tilesToRemove.Add(new int[2] {
                                MapsManager.maps[(int)RoomsManager.Rooms.escape0].roomHeightTiles - i - 1,
                                MapsManager.maps[(int)RoomsManager.Rooms.escape0].roomWidthTiles - 40 + j
                            });
                        }
                    }
                    MapsManager.maps[(int)RoomsManager.CurrentRoom].RemoveGroupOfTiles(tilesToRemove, 0.01f, 3, 0.3f);
                    happening             = Events.lavaEruption1_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lowerFloor1_escape0:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[0].active = true;
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[1].active = true;
                    happening             = Events.lowerFloor1_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.removeFloor1_escape0:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[0].RemovePlatform();
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[1].RemovePlatform();
                    happening             = Events.removeFloor1_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lavaEruption2_escape0:
                    LavaGeyserManager.ShootGeyser(new float[]
                    {
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 664,
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 640
                    }, 0);
                    happening             = Events.lavaEruption2_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lavaEruption3_escape0:
                    LavaGeyserManager.ShootGeyser(new float[]
                    {
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 1032,
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 1008
                    }, 0, -600);
                    happening             = Events.lavaEruption3_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lavaEruption4_escape0:
                    LavaGeyserManager.ShootGeyser(new float[]
                    {
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 972,
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 948
                    }, 0, -600);
                    happening             = Events.lavaEruption4_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.raiseFloor2_escape0:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[2].active = true;
                    happening             = Events.raiseFloor2_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lavaEruption5_escape0:
                    LavaGeyserManager.ShootGeyser(new float[] { MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 1388 }, 1.5f, -800);
                    happening             = Events.lavaEruption5_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.raiseFloor3_escape0:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].movingPlatforms[3].active = true;
                    happening             = Events.raiseFloor3_escape0;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lavaEruption6_escape0:
                    LavaGeyserManager.ShootGeyser(new float[]
                    {
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 1688,
                        MapsManager.maps[(int)RoomsManager.Rooms.escape0].RoomWidthtPx - 1664
                    }, 0);
                    happening             = Events.lavaEruption6_escape0;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.escape1)
            {
                switch (_event)
                {
                case Events.activatePlatform_escape1:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.Rooms.escape1].movingPlatforms[0].active = true;
                    happening             = Events.activatePlatform_escape1;
                    elapsedEventsDuration = 0;
                    break;

                case Events.raiseFloor1_escape1:
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.Rooms.escape1].movingPlatforms[1].active = true;
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.Rooms.escape1].movingPlatforms[2].active = true;
                    happening             = Events.raiseFloor1_escape1;
                    elapsedEventsDuration = 0;
                    break;

                case Events.lavaEruption1_escape1:
                    LavaGeyserManager.SweepAcross(0.2f, 0, 10, 0, 96, true);
                    happening             = Events.lavaEruption1_escape1;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
            else if (RoomsManager.CurrentRoom == RoomsManager.Rooms.escape2)
            {
                switch (_event)
                {
                case Events.lavaEruption_escape2:
                    LavaGeyserManager.ShootGeyser(new float[] { 396 }, 0f);
                    LavaGeyserManager.ShootGeyser(new float[] { 376 }, 0.2f);
                    LavaGeyserManager.ShootGeyser(new float[] { 356 }, 0.4f);
                    LavaGeyserManager.ShootGeyser(new float[] { 336 }, 0.6f);
                    LavaGeyserManager.ShootGeyser(new float[] { 316 }, 0.8f);
                    LavaGeyserManager.ShootGeyser(new float[] { 296 }, 1f);
                    LavaGeyserManager.ShootGeyser(new float[] { 276 }, 1.2f);
                    LavaGeyserManager.ShootGeyser(new float[] { 256 }, 1.4f);
                    LavaGeyserManager.ShootGeyser(new float[] { 236 }, 1.6f);
                    LavaGeyserManager.ShootGeyser(new float[] { 216 }, 1.8f);
                    LavaGeyserManager.ShootGeyser(new float[] { 196 }, 2f);
                    LavaGeyserManager.ShootGeyser(new float[] { 176 }, 2.2f);
                    LavaGeyserManager.ShootGeyser(new float[] { 156 }, 2.4f);
                    LavaGeyserManager.ShootGeyser(new float[] { 136 }, 2.6f);
                    LavaGeyserManager.ShootGeyser(new float[] { 116 }, 2.8f);
                    LavaGeyserManager.ShootGeyser(new float[] { 96 }, 3f);
                    happening             = Events.lavaEruption_escape2;
                    elapsedEventsDuration = 0;
                    break;
                }
            }
        }
Example #4
0
        //reset some events upon player death
        public static void Reset()
        {
            elapsedEventsDuration = 0;
            happening             = Events.none;
            if (eventAlreadyHappened[(int)Events.keySpawns1_tutorial3] && !eventAlreadyHappened[(int)Events.key1Collected_tutorial3])
            {
                CollectablesManager.collectablesRoomManagers[(int)RoomsManager.Rooms.tutorial3].RemoveCollectablesFromMap();
                eventAlreadyHappened[(int)Events.keySpawns1_tutorial3] = false;
            }
            else if (eventAlreadyHappened[(int)Events.keySpawns2_tutorial3] && !eventAlreadyHappened[(int)Events.key2Collected_tutorial3])
            {
                CollectablesManager.collectablesRoomManagers[(int)RoomsManager.Rooms.tutorial3].RemoveCollectablesFromMap();
                eventAlreadyHappened[(int)Events.keySpawns2_tutorial3] = false;
            }
            else if (eventAlreadyHappened[(int)Events.keyAndPowerUpSpawn_midBoss] &&
                     !eventAlreadyHappened[(int)Events.pUpCollected_midBoss])
            {
                CollectablesManager.collectablesRoomManagers[(int)RoomsManager.Rooms.midBoss].AddCollectableToMap(
                    new Collectable(new Point(280, 140), Collectable.ItemType.wallJump_powerup));
            }
            else if (eventAlreadyHappened[(int)Events.spawnKey_altar] &&
                     !eventAlreadyHappened[(int)Events.keyCollected_altar])
            {
                CollectablesManager.collectablesRoomManagers[(int)RoomsManager.Rooms.churchAltarRoom].AddCollectableToMap(
                    new Collectable(new Point(230, 400), Collectable.ItemType.silverKey));
            }
            else if (FinalBoss.Dead)
            {
                List <int[]> tilesToRemove = new List <int[]>();
                for (int col = 1; col < (MapsManager.maps[(int)RoomsManager.Rooms.finalBoss].roomWidthTiles + 1) / 2; col++)
                {
                    tilesToRemove.Add(new int[2] {
                        57, col
                    });
                    tilesToRemove.Add(new int[2] {
                        57, MapsManager.maps[(int)RoomsManager.Rooms.finalBoss].roomWidthTiles - col - 1
                    });
                    tilesToRemove.Add(new int[2] {
                        56, col
                    });
                    tilesToRemove.Add(new int[2] {
                        56, MapsManager.maps[(int)RoomsManager.Rooms.finalBoss].roomWidthTiles - col - 1
                    });
                }
                MapsManager.maps[(int)RoomsManager.Rooms.finalBoss].RemoveGroupOfTiles(tilesToRemove, 0, 100);
            }
            switch (RoomsManager.CurrentRoom)
            {
            case RoomsManager.Rooms.finalBoss:
                if (!FinalBoss.Dead)
                {
                    eventAlreadyHappened[(int)Events.terrainCollapseFinalBoss]   = false;
                    eventAlreadyHappened[(int)Events.finalBossComesAlive]        = false;
                    eventAlreadyHappened[(int)Events.activatePlatformsFinalBoss] = false;
                    eventAlreadyHappened[(int)Events.escapeFinalBossRoom]        = false;
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].Reset();
                    MapsManager.resetMap(RoomsManager.CurrentRoom);
                    FinalBoss.Reset();
                }
                break;

            case RoomsManager.Rooms.escape0:
                if (RoomsManager.PreviousRoom == RoomsManager.Rooms.finalBoss)
                {
                    eventAlreadyHappened[(int)Events.lavaEruption1_escape0] = false;
                    eventAlreadyHappened[(int)Events.lowerFloor1_escape0]   = false;
                    eventAlreadyHappened[(int)Events.removeFloor1_escape0]  = false;
                    eventAlreadyHappened[(int)Events.lavaEruption2_escape0] = false;
                    eventAlreadyHappened[(int)Events.lavaEruption3_escape0] = false;
                    eventAlreadyHappened[(int)Events.lavaEruption4_escape0] = false;
                    eventAlreadyHappened[(int)Events.raiseFloor2_escape0]   = false;
                    eventAlreadyHappened[(int)Events.lavaEruption5_escape0] = false;
                    eventAlreadyHappened[(int)Events.raiseFloor3_escape0]   = false;
                    eventAlreadyHappened[(int)Events.lavaEruption6_escape0] = false;
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].Reset();
                    MapsManager.resetMap(RoomsManager.CurrentRoom);
                }
                break;

            case RoomsManager.Rooms.escape1:
                if (RoomsManager.PreviousRoom == RoomsManager.Rooms.escape0)
                {
                    eventAlreadyHappened[(int)Events.activatePlatform_escape1] = false;
                    eventAlreadyHappened[(int)Events.raiseFloor1_escape1]      = false;
                    eventAlreadyHappened[(int)Events.lavaEruption1_escape1]    = false;
                    PlatformsManager.platformsRoomManagers[(int)RoomsManager.CurrentRoom].Reset();
                }
                break;
            }
        }
Example #5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

#if LEVEL_EDITOR
            MapsManager.Inizialize(Content.Load <Texture2D>("tiles"));
            CameraManager.Inizialize
            (
                new Texture2D[(int)RoomsManager.Rooms.total]
            {
                Content.Load <Texture2D>(@"backgrounds\tutorial0"),
                Content.Load <Texture2D>(@"backgrounds\tutorial1"),
                Content.Load <Texture2D>(@"backgrounds\tutorial2"),
                Content.Load <Texture2D>(@"backgrounds\tutorial3"),
                Content.Load <Texture2D>(@"backgrounds\tutorial4"),
                Content.Load <Texture2D>(@"backgrounds\bellTower0"),
                Content.Load <Texture2D>(@"backgrounds\bellTower1"),
                Content.Load <Texture2D>(@"backgrounds\bellTower2"),
                Content.Load <Texture2D>(@"backgrounds\midBoss"),
                Content.Load <Texture2D>(@"backgrounds\groundFloor"),
                Content.Load <Texture2D>(@"backgrounds\altarRoom"),
                Content.Load <Texture2D>(@"backgrounds\firstFloor"),
                Content.Load <Texture2D>(@"backgrounds\secondFloor"),
                Content.Load <Texture2D>(@"backgrounds\descent"),
                Content.Load <Texture2D>(@"backgrounds\finalBoss"),
                Content.Load <Texture2D>(@"backgrounds\escape0"),
                Content.Load <Texture2D>(@"backgrounds\escape1"),
                Content.Load <Texture2D>(@"backgrounds\escape2"),
            }
            );
            spriteFont = Content.Load <SpriteFont>(@"fonts\monologue");
            PlatformsManager.Inizialize(Content.Load <Texture2D>("platforms"));
            levelEditor = new LevelEditor(Content.Load <SpriteFont>(@"fonts\arial32"),
                                          Content.Load <SpriteFont>(@"fonts\arial14"),
                                          Content.Load <Texture2D>("whiteTile"));
#else
            //load the game assets here
            currentGameState = GameStates.titleScreen;
            LoadSaveManager.Inizialize();
            GameStats.Inizialize();
            Achievements.Initialize(Content.Load <SpriteFont>(@"fonts\monologue"),
                                    Content.Load <SpriteFont>(@"fonts\LiberationMono12"));
            MapsManager.Inizialize(Content.Load <Texture2D>("tiles"));
            CameraManager.Inizialize
            (
                new Texture2D[(int)RoomsManager.Rooms.total]
            {
                Content.Load <Texture2D>(@"backgrounds\tutorial0"),
                Content.Load <Texture2D>(@"backgrounds\tutorial1"),
                Content.Load <Texture2D>(@"backgrounds\tutorial2"),
                Content.Load <Texture2D>(@"backgrounds\tutorial3"),
                Content.Load <Texture2D>(@"backgrounds\tutorial4"),
                Content.Load <Texture2D>(@"backgrounds\bellTower0"),
                Content.Load <Texture2D>(@"backgrounds\bellTower1"),
                Content.Load <Texture2D>(@"backgrounds\bellTower2"),
                Content.Load <Texture2D>(@"backgrounds\midBoss"),
                Content.Load <Texture2D>(@"backgrounds\groundFloor"),
                Content.Load <Texture2D>(@"backgrounds\altarRoom"),
                Content.Load <Texture2D>(@"backgrounds\firstFloor"),
                Content.Load <Texture2D>(@"backgrounds\secondFloor"),
                Content.Load <Texture2D>(@"backgrounds\descent"),
                Content.Load <Texture2D>(@"backgrounds\finalBoss"),
                Content.Load <Texture2D>(@"backgrounds\escape0"),
                Content.Load <Texture2D>(@"backgrounds\escape1"),
                Content.Load <Texture2D>(@"backgrounds\escape2"),
            }
            );
            PlatformsManager.Inizialize(Content.Load <Texture2D>("platforms"));
            ProjectilesManager.Inizialize(Content.Load <Texture2D>("animatedSprites"));
            Player.Inizialize(Content.Load <Texture2D>(@"characters\player"), new Vector2(16, 185));
            RoomsManager.Inizialize();
            GameEvents.Inizialize();
            FireBallsManager.Inizialize(Content.Load <Texture2D>("animatedSprites"));
            LavaGeyserManager.Inizialize(Content.Load <Texture2D>("animatedSprites"));
            EnemyManager.Initialise(Content.Load <Texture2D>(@"characters\enemy1"), Content.Load <Texture2D>(@"characters\enemy2"));
            MidBoss.Initialise(Content.Load <Texture2D>(@"characters\midboss"));
            FinalBoss.Inizialize(Content.Load <Texture2D>(@"characters\finalBoss"),
                                 new Texture2D[] { Content.Load <Texture2D>(@"characters\stoneWing"),
                                                   Content.Load <Texture2D>(@"characters\healthyWing"),
                                                   Content.Load <Texture2D>(@"characters\damagedWing"),
                                                   Content.Load <Texture2D>(@"characters\deadWing") });
            CollectablesManager.Inizialize(Content.Load <Texture2D>("animatedSprites"));
            MonologuesManager.Inizialize(Content.Load <Texture2D>("animatedSprites"),
                                         Content.Load <SpriteFont>(@"fonts\monologue"));
            DoorsManager.Inizialize(Content.Load <Texture2D>("animatedSprites"));
            AnimatedSpritesManager.Inizialize(Content.Load <Texture2D>("animatedSprites"));
            TorchManager.Initialize(Content.Load <Texture2D>("firePot"));
            PlayerDeathManager.Initialize(Content.Load <Texture2D>(@"menus\deathScreen"),
                                          Content.Load <Texture2D>(@"menus\menuOptions"));
            MenusManager.Initialize(Content.Load <Texture2D>(@"menus\menuOptions"),
                                    new Texture2D[]
            {
                Content.Load <Texture2D>(@"menus\titleScreen"),
                Content.Load <Texture2D>(@"menus\controls"),
                Content.Load <Texture2D>(@"menus\credits"),
                Content.Load <Texture2D>(@"menus\pause"),
                Content.Load <Texture2D>(@"menus\quit"),
                Content.Load <Texture2D>(@"menus\doubleJump"),
                Content.Load <Texture2D>(@"menus\wallJump"),
                Content.Load <Texture2D>(@"menus\achievements"),
            });
            CutscenesManager.Initialize(Content.Load <Texture2D>(@"characters\enemy1"),
                                        Content.Load <Texture2D>(@"characters\player"),
                                        Content.Load <SpriteFont>(@"fonts\monologue"));
            SoundEffects.Initialise
            (
                //Player Sound Effects
                Content.Load <SoundEffect>(@"sounds\pJump"),
                Content.Load <SoundEffect>(@"sounds\pShoot"),
                Content.Load <SoundEffect>(@"sounds\pHurt"),
                Content.Load <SoundEffect>(@"sounds\pickup"),

                //Enemy Sound Effects
                Content.Load <SoundEffect>(@"sounds\enemyAttack"),
                Content.Load <SoundEffect>(@"sounds\enemyHurt"),
                Content.Load <SoundEffect>(@"sounds\e2Attack"),

                //Midboss Sound Effects
                Content.Load <SoundEffect>(@"sounds\midMove"),
                Content.Load <SoundEffect>(@"sounds\midAttack"),
                Content.Load <SoundEffect>(@"sounds\midHurt"),

                Content.Load <SoundEffect>(@"sounds\finAttack"),
                Content.Load <SoundEffect>(@"sounds\finHurt"),
                Content.Load <SoundEffect>(@"sounds\finAwaken"),
                Content.Load <SoundEffect>(@"sounds\finRecover"),
                Content.Load <Song>(@"sounds\finalBossMusic")
            );
            gameInitialized = true;
            Zoom1();
#endif
        }