예제 #1
0
        public void LoadContent(ContentManager Content)
        {
            mountain.Content = Content;
            clouds.initialize(Content, "mapTwo/sky", details.Viewport.Width, details.Viewport.Height, -2);
            backClouds.initialize(Content, "mapTwo/sky2", details.Viewport.Width, details.Viewport.Height, -1);
            soundEffects.Initialize(Content);
            styraxTheHero.LoadContent(Content);
            zombieDeath.initialize(Content);
            abilitiesManager.Initialize(Content, styraxTheHero);
            shuriTexture = Content.Load <Texture2D>("shuriken_Final");
            megaTexture  = Content.Load <Texture2D>("megaShuriken");
            shur.Initialize(shuriTexture, megaTexture, details, Content, abilitiesManager, zombieDeath, soundEffects);
            zombies.Initialize(details, styraxTheHero, Content, zombieDeath);

            #region mapContent

            mountains.Initialize(styraxTheHero);
            gui    = new GUI(Content, styraxTheHero);
            camera = new Camera(details.Viewport, gui, healthbar);
            styraxTheHero.getMap2(mountains);
            #endregion


            healthbar.LoadContent(Content, zombies);

            styraxTheHero.getManagers(zombies, shur);

            zombies.getMap2(mountains);
            zombies.getSManager(shur, healthbar);
            zombies.getSound(soundEffects);
            shur.getEnManager(zombies);
            shur.giveManager();
        }
예제 #2
0
        public void Update(GameTime gameTime)
        {
            if (zombies.noMoreOne)
            {
                // levelHasFinished = true;
                startCutscene = true;
            }

            if (startCutscene)
            {
                styraxTheHero.iAmInACutscene = true;
                styraxTheHero.endPosition    = endGamePos;

                if (Vector2.Distance(styraxTheHero.position, endGamePos) < 10)
                {
                    styraxTheHero.reachedEndPoint = true;
                    timer.startTimer(13);
                    timer.update(gameTime);
                    if (timer.checkTimer)
                    {
                        levelHasFinished = true;
                    }
                }
            }



            zombiesDeath.updateExplosions(gameTime);
            styraxTheHero.Update(gameTime);
            if (styraxTheHero.hasFallen)
            {
                if (styraxTheHero.gameIsOver)
                {
                    isGameOver = true;
                }
            }
            camera.Update(gameTime, styraxTheHero);

            shur.Update(gameTime, styraxTheHero, camera);
            zombies.UpdateEnemies(gameTime);

            //  map.Update(gameTime, zombies, styraxTheHero, shur);


            abilitiesManager.Update(gameTime);
            shur.getEnManager(zombies);
            shur.giveManager();
            bgLayer1.Update();
            if (waveManager.bossBattle)
            {
                healthbar.Update(gameTime);
            }
        }