Beispiel #1
0
        public override void Update()
        {
            switch (state)
            {
            case GameState.INIT_GAME:

                break;

            case GameState.TUTORIAL:
                TutorialUpdate();

                break;

            case GameState.GAMEPLAY:
                particularObjectManager.UpdateObjects(gameTime);
                bulletManager.UpdateObjects(gameTime);

                physicalMap.Update(gameTime);
                camera.Update(gameTime);


                if (megaMan.getPosX() > readonlyBossX && readonlybossTrigger)
                {
                    readonlybossTrigger = false;
                    switchState(GameState.TUTORIAL);
                    tutorialState  = TutorialState.MEETreadonlyBOSS;
                    storyTutorial  = 0;
                    openIntroGameY = 550;

                    boss = new FinalBoss(readonlyBossX + 700, 460, this);
                    boss.setTeamType(ParticularObject.TeamType.ENEMY_TEAM);
                    boss.setDirection(ParticularObject.MainDir.LEFT_DIR);
                    particularObjectManager.addObject(boss);
                }

                if (megaMan.getState() == ParticularObject.MainState.DEATH)
                {
                    numberOfLife--;
                    if (numberOfLife >= 0)
                    {
                        megaMan.setBlood(100);
                        megaMan.setPosY(megaMan.getPosY() - 50);
                        megaMan.setState(ParticularObject.MainState.NOBEHURT);
                        particularObjectManager.addObject(megaMan);
                    }
                    else
                    {
                        switchState(GameState.GAMEOVER);
                        //bgMusic.stop();
                    }
                }
                if (!readonlybossTrigger && boss.getState() == ParticularObject.MainState.DEATH)
                {
                    switchState(GameState.GAMEWIN);
                }

                break;

            case GameState.GAMEOVER:

                break;

            case GameState.GAMEWIN:

                break;
            }
        }