Example #1
0
        private void initalizeBackground()
        {
            backgrounds = new BackgroundManager();

            if (nextLevel.ToString() == "Relic")
            {
                backgrounds.AddBackground(new Sprite("Backgrounds/Relic/relicBackground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Relic/relicBlockers", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Relic/meteorAnimated2", DEFAUT_SCREEN_SIZE / 2));
            }
            else if (nextLevel.ToString() == "Archipelago")
            {
                backgrounds.AddBackground(new Sprite("Backgrounds/Archipelago/archipelago_background", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Archipelago/archipelago_trees", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Archipelago/archipelago_solid", DEFAUT_SCREEN_SIZE / 2));
            }
            else if (nextLevel.ToString() == "Faercrag")
            {
                backgrounds.AddBackground(new Sprite("Backgrounds/Faercrag/faercragBackground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Faercrag/faercragBlockers", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Faercrag/faercragImpassable", DEFAUT_SCREEN_SIZE / 2));
            }
            else if (nextLevel.ToString() == "Plaza")
            {
                backgrounds.AddForeground(new Sprite("Backgrounds/Plaza/plazaLighting", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddBackground(new Sprite("Backgrounds/Plaza/plazaBackground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddBackground(new Sprite("Backgrounds/Plaza/plazaBlockers", DEFAUT_SCREEN_SIZE / 2));
                Sprite light = new Sprite("Backgrounds/Plaza/light", new Vector2(476, 184));
                backgrounds.AddBackground(light);
                light = new Sprite("Backgrounds/Plaza/light", new Vector2(832, 182));
                light.Turn((float)(Math.PI) * .25f);
                backgrounds.AddBackground(light);
                light = new Sprite("Backgrounds/Plaza/light", new Vector2(832, 512));
                light.Turn((float)(Math.PI) * .5f);
                backgrounds.AddBackground(light);
            }
            else if (nextLevel.ToString() == "Switch")
            {
                float   x     = 25;
                float   y     = -40;
                Vector2 crane = DEFAUT_SCREEN_SIZE / 2;
                crane.X += 116;
                crane.Y -= 112;

                backgrounds.AddBackground(new Sprite("Backgrounds/Switch/switchBackground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Switch/switchForeground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Switch/switchBlockers", DEFAUT_SCREEN_SIZE / 2));

                Sprite belts = new Sprite("Backgrounds/Switch/BL", new Vector2(564 + x, 288 + y));
                backgrounds.AddForeground(belts);
                belts = new Sprite("Backgrounds/Switch/BLr", new Vector2(712.5f + x, 435 + y));
                belts.Turn((float)(Math.PI));
                backgrounds.AddForeground(belts);
                belts = new Sprite("Backgrounds/Switch/BRr", new Vector2(616 + x, 221 + y));
                backgrounds.AddForeground(belts);
                belts = new Sprite("Backgrounds/Switch/BR", new Vector2(779 + x, 384 + y));
                belts.Turn((float)(Math.PI));
                backgrounds.AddForeground(belts);
                belts = new Sprite("Backgrounds/Switch/BT", new Vector2(687 + x, 192.5f + y));
                backgrounds.AddForeground(belts);
                belts = new Sprite("Backgrounds/Switch/BTr", new Vector2(807 + x, 313 + y));
                belts.Turn((float)(Math.PI));
                backgrounds.AddForeground(belts);
                belts = new Sprite("Backgrounds/Switch/DBr", new Vector2(782 + x, 217 + y));
                belts.Turn((float)(Math.PI));
                backgrounds.AddForeground(belts);
                belts = new Sprite("Backgrounds/Switch/DBr", new Vector2(641 + x, 359 + y));
                backgrounds.AddForeground(belts);
                backgrounds.AddForeground(new Sprite("Backgrounds/Switch/switchCrane", crane));
            }
            else if (nextLevel.ToString() == "Zen Garden")
            {
                backgrounds.AddBackground(new Sprite("Backgrounds/ZenGarden/zenBackground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/ZenGarden/zenForeground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/ZenGarden/zenBlockers", DEFAUT_SCREEN_SIZE / 2));
            }
            else if (nextLevel.ToString() == "Caged")
            {
                backgrounds.AddForeground(new Sprite("Backgrounds/Caged/cagedBackground", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddForeground(new Sprite("Backgrounds/Caged/cagedBlockers", DEFAUT_SCREEN_SIZE / 2));
                backgrounds.AddBackground(new Sprite("Backgrounds/Caged/lava", DEFAUT_SCREEN_SIZE / 2));
            }
        }