Пример #1
0
        ///////prototipo
        public override void fadeFinished(Fade fadeObject)
        {
            if (fadeObject.getEffect() == Fade.sFADE_IN_EFFECT_GRADATIVE)
            {
                restartTimer(2);
            }
            else
            if (fadeObject.getEffect() == Fade.sFADE_OUT_EFFECT_GRADATIVE)
            {
                mBackgroundCounter++;
                if (mBackgroundCounter < cMAX_BG_COUNTER)
                {
                    mCurrentBackground = mList.ElementAt(mBackgroundCounter);
                    restartTimer(2);
                }
                else
                {
                    Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_SPLASHSCREEN, true);
                }
            }

            //GC.KeepAlive(aTimer);
        }
Пример #2
0
        public override void fadeFinished(Fade fadeObject)
        {
            if (fadeObject.getEffect() == Fade.sFADE_IN_EFFECT_GRADATIVE)
            {
                mAuthorizeUpdate = true;
                restartTimer();

                mFade = null;
            }
            else
            if (fadeObject.getEffect() == Fade.sFADE_OUT_EFFECT_GRADATIVE)
            {
                //goToGameScreen();
                SoundManager.StopMusic();
                if (mCurrentMacroMapState != MacroMapState.Finish)
                {
                    Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_GAMEPLAY, true, true);
                }
                else
                {
                    Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_ENDING_SCREEN, true, true);
                }
            }
        }
Пример #3
0
        public MainMenuScreen()
        {
            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setStageAndColor(1, ProgressObject.PlayerColor.BLUE));

            if (!SoundManager.isPlaying())
            {
                SoundManager.PlayMusic("sound\\music\\theme");
            }
            mSpriteBatch = Game1.getInstance().getScreenManager().getSpriteBatch();

            mBackgroundImage = new Background("mainmenu\\MainMenu_bg");
            mBackgroundImage.addPart(new String[1] {
                "mainmenu\\MainMenu_barco"
            }, 1, 125, 110, 80, 600 - 211);
            mBackgroundImage.addPart(new String[1] {
                "mainmenu\\MainMenu_areia"
            }, 1, 801, 201, 0, 600 - 201);

            mBackgroundImage.addPart(new String[36] {
                "mainmenu\\Mato01\\MainMenu_mato01_00000",
                "mainmenu\\Mato01\\MainMenu_mato01_00001",
                "mainmenu\\Mato01\\MainMenu_mato01_00002",
                "mainmenu\\Mato01\\MainMenu_mato01_00003",
                "mainmenu\\Mato01\\MainMenu_mato01_00004",
                "mainmenu\\Mato01\\MainMenu_mato01_00005",
                "mainmenu\\Mato01\\MainMenu_mato01_00006",
                "mainmenu\\Mato01\\MainMenu_mato01_00007",
                "mainmenu\\Mato01\\MainMenu_mato01_00008",
                "mainmenu\\Mato01\\MainMenu_mato01_00009",
                "mainmenu\\Mato01\\MainMenu_mato01_00010",
                "mainmenu\\Mato01\\MainMenu_mato01_00011",
                "mainmenu\\Mato01\\MainMenu_mato01_00012",
                "mainmenu\\Mato01\\MainMenu_mato01_00013",
                "mainmenu\\Mato01\\MainMenu_mato01_00014",
                "mainmenu\\Mato01\\MainMenu_mato01_00015",
                "mainmenu\\Mato01\\MainMenu_mato01_00016",
                "mainmenu\\Mato01\\MainMenu_mato01_00017",
                "mainmenu\\Mato01\\MainMenu_mato01_00018",
                "mainmenu\\Mato01\\MainMenu_mato01_00019",
                "mainmenu\\Mato01\\MainMenu_mato01_00020",
                "mainmenu\\Mato01\\MainMenu_mato01_00021",
                "mainmenu\\Mato01\\MainMenu_mato01_00022",
                "mainmenu\\Mato01\\MainMenu_mato01_00023",
                "mainmenu\\Mato01\\MainMenu_mato01_00024",
                "mainmenu\\Mato01\\MainMenu_mato01_00025",
                "mainmenu\\Mato01\\MainMenu_mato01_00026",
                "mainmenu\\Mato01\\MainMenu_mato01_00027",
                "mainmenu\\Mato01\\MainMenu_mato01_00028",
                "mainmenu\\Mato01\\MainMenu_mato01_00029",
                "mainmenu\\Mato01\\MainMenu_mato01_00030",
                "mainmenu\\Mato01\\MainMenu_mato01_00031",
                "mainmenu\\Mato01\\MainMenu_mato01_00032",
                "mainmenu\\Mato01\\MainMenu_mato01_00033",
                "mainmenu\\Mato01\\MainMenu_mato01_00034",
                "mainmenu\\Mato01\\MainMenu_mato01_00035",
            }, 1, 232, 111, 0, 600 - 111);

            mBackgroundImage.addPart(new String[36] {
                "mainmenu\\Mato02\\Mato02__00000",
                "mainmenu\\Mato02\\Mato02__00001",
                "mainmenu\\Mato02\\Mato02__00002",
                "mainmenu\\Mato02\\Mato02__00003",
                "mainmenu\\Mato02\\Mato02__00004",
                "mainmenu\\Mato02\\Mato02__00005",
                "mainmenu\\Mato02\\Mato02__00006",
                "mainmenu\\Mato02\\Mato02__00007",
                "mainmenu\\Mato02\\Mato02__00008",
                "mainmenu\\Mato02\\Mato02__00009",
                "mainmenu\\Mato02\\Mato02__00010",
                "mainmenu\\Mato02\\Mato02__00011",
                "mainmenu\\Mato02\\Mato02__00012",
                "mainmenu\\Mato02\\Mato02__00013",
                "mainmenu\\Mato02\\Mato02__00014",
                "mainmenu\\Mato02\\Mato02__00015",
                "mainmenu\\Mato02\\Mato02__00016",
                "mainmenu\\Mato02\\Mato02__00017",
                "mainmenu\\Mato02\\Mato02__00018",
                "mainmenu\\Mato02\\Mato02__00019",
                "mainmenu\\Mato02\\Mato02__00020",
                "mainmenu\\Mato02\\Mato02__00021",
                "mainmenu\\Mato02\\Mato02__00022",
                "mainmenu\\Mato02\\Mato02__00023",
                "mainmenu\\Mato02\\Mato02__00024",
                "mainmenu\\Mato02\\Mato02__00025",
                "mainmenu\\Mato02\\Mato02__00026",
                "mainmenu\\Mato02\\Mato02__00027",
                "mainmenu\\Mato02\\Mato02__00028",
                "mainmenu\\Mato02\\Mato02__00029",
                "mainmenu\\Mato02\\Mato02__00030",
                "mainmenu\\Mato02\\Mato02__00031",
                "mainmenu\\Mato02\\Mato02__00032",
                "mainmenu\\Mato02\\Mato02__00033",
                "mainmenu\\Mato02\\Mato02__00034",
                "mainmenu\\Mato02\\Mato02__00035",
            }, 1, 223, 111, 800 - 223, 600 - 111);

            mBackgroundImage.addPart(new String[36] {
                "mainmenu\\Mato03\\Mato03_00000",
                "mainmenu\\Mato03\\Mato03_00001",
                "mainmenu\\Mato03\\Mato03_00002",
                "mainmenu\\Mato03\\Mato03_00003",
                "mainmenu\\Mato03\\Mato03_00004",
                "mainmenu\\Mato03\\Mato03_00005",
                "mainmenu\\Mato03\\Mato03_00006",
                "mainmenu\\Mato03\\Mato03_00007",
                "mainmenu\\Mato03\\Mato03_00008",
                "mainmenu\\Mato03\\Mato03_00009",
                "mainmenu\\Mato03\\Mato03_00010",
                "mainmenu\\Mato03\\Mato03_00011",
                "mainmenu\\Mato03\\Mato03_00012",
                "mainmenu\\Mato03\\Mato03_00013",
                "mainmenu\\Mato03\\Mato03_00014",
                "mainmenu\\Mato03\\Mato03_00015",
                "mainmenu\\Mato03\\Mato03_00016",
                "mainmenu\\Mato03\\Mato03_00017",
                "mainmenu\\Mato03\\Mato03_00018",
                "mainmenu\\Mato03\\Mato03_00019",
                "mainmenu\\Mato03\\Mato03_00020",
                "mainmenu\\Mato03\\Mato03_00021",
                "mainmenu\\Mato03\\Mato03_00022",
                "mainmenu\\Mato03\\Mato03_00023",
                "mainmenu\\Mato03\\Mato03_00024",
                "mainmenu\\Mato03\\Mato03_00025",
                "mainmenu\\Mato03\\Mato03_00026",
                "mainmenu\\Mato03\\Mato03_00027",
                "mainmenu\\Mato03\\Mato03_00028",
                "mainmenu\\Mato03\\Mato03_00029",
                "mainmenu\\Mato03\\Mato03_00030",
                "mainmenu\\Mato03\\Mato03_00031",
                "mainmenu\\Mato03\\Mato03_00032",
                "mainmenu\\Mato03\\Mato03_00033",
                "mainmenu\\Mato03\\Mato03_00034",
                "mainmenu\\Mato03\\Mato03_00035",
            }, 1, 406, 144, 50, 0);

            //mBackgroundImage.addPart(new String[1] { "mainmenu\\MainMenu_mato01" }, 1, 232, 111, 0, 600 - 111);
            //mBackgroundImage.addPart(new String[1] { "mainmenu\\MainMenu_mato02" }, 1, 345, 135, 800 - 340, 600 - 135);
            mBackgroundImage.loadContent(Game1.getInstance().getScreenManager().getContent());

            //SPLASH
            //mGamelogo = Game1.getInstance().getScreenManager().getContent().Load<Texture2D>("mainmenu\\logo");
            //mTextureClickToStart = Game1.getInstance().getScreenManager().getContent().Load<Texture2D>("mainmenu\\clicktostart");

            mList.Add(mBackgroundImage);

            mCurrentBackground = mList.ElementAt(0);

            mCursor = new Cursor();
            mCursor.loadContent(Game1.getInstance().getScreenManager().getContent());

            mButtonContinue = new Button("mainmenu\\buttons\\adventure_continue", "mainmenu\\buttons\\adventure_continue_select", "mainmenu\\buttons\\adventure_continue_selected", new Rectangle(282, 145, 286, 113));
            mButtonNewGame  = new Button("mainmenu\\buttons\\adventure_new", "mainmenu\\buttons\\adventure_new_select", "mainmenu\\buttons\\adventure_new_selected", new Rectangle(282, 250, 286, 113));

            mButtonContinue.loadContent(Game1.getInstance().getScreenManager().getContent());
            mButtonNewGame.loadContent(Game1.getInstance().getScreenManager().getContent());


            mButtonPlay    = new Button("mainmenu\\buttons\\mainmenu_play", "mainmenu\\buttons\\mainmenu_play_select", "mainmenu\\buttons\\mainmenu_play_selected", new Rectangle(275, 155, 286, 103));
            mButtonHelp    = new Button("mainmenu\\buttons\\mainmenu_help", "mainmenu\\buttons\\mainmenu_help_select", "mainmenu\\buttons\\mainmenu_help_selected", new Rectangle(304, 255, 225, 93));
            mButtonCredits = new Button("mainmenu\\buttons\\mainmenu_credits", "mainmenu\\buttons\\mainmenu_credits_select", "mainmenu\\buttons\\mainmenu_credits_selected", new Rectangle(/*800-45*/ 10, 550, 38, 39));
            mButtonExit    = new Button("mainmenu\\buttons\\exit", "mainmenu\\buttons\\exit_select", "mainmenu\\buttons\\exit_selected", new Rectangle(304, 355, 225, 93));

            mButtonFullscreen = new Button("mainmenu\\buttons\\full", "mainmenu\\buttons\\full_select", "mainmenu\\buttons\\full_selected", new Rectangle(650, 530, 64, 47));

            mGroupButtons = new GameObjectsGroup <Button>();
            //mGroupButtons.addGameObject(mButtonContinue);
            mGroupButtons.addGameObject(mButtonPlay);
            mGroupButtons.addGameObject(mButtonHelp);
            mGroupButtons.addGameObject(mButtonCredits);
            mGroupButtons.addGameObject(mButtonExit);
            mGroupButtons.addGameObject(mButtonFullscreen);

            mGroupButtons.addGameObject(mButtonContinue);
            mGroupButtons.addGameObject(mButtonNewGame);

            mGroupButtons.loadContent(Game1.getInstance().getScreenManager().getContent());

            mSoundIcon = new SoundIcon(new Vector2(710, 514));
            mSoundIcon.loadContent(Game1.getInstance().getScreenManager().getContent());


            mFade = new Fade(this, "fades\\blackfade", Fade.SPEED.FAST);

            executeFade(mFade, Fade.sFADE_IN_EFFECT_GRADATIVE);

            //mButtonPlay.loadContent(Game1.getInstance().getScreenManager().getContent());
            //mButtonHelp.loadContent(Game1.getInstance().getScreenManager().getContent());
            //mButtonCredits.loadContent(Game1.getInstance().getScreenManager().getContent());

            //Game1.print("LOC: "  + mGroupButtons.getGameObject(2).getLocation());

            mCursor.backToMenuCursor();

            SoundManager.LoadSound(cSOUND_HIGHLIGHT);
        }
Пример #4
0
        private void processButtonAction(Button button)
        {
            if (button == mButtonPlay)
            {
                SoundManager.PlaySound(cSOUND_HIGHLIGHT);
                mFade = new Fade(this, "fades\\blackfade");
                //
                //TODO if.....
                //ObjectSerialization.Save<ProgressObject>(Game1.sPROGRESS_FILE_NAME, new ProgressObject(1, ProgressObject.PlayerColor.GREEN));

                Game1.progressObject = ExtraFunctions.loadProgress();

                if (Game1.progressObject != null)
                {
                    if (Game1.progressObject.getCurrentStage() > 1)
                    {
                        configureToContinueScreen(true);
                    }
                    else
                    {
                        //SoundManager.stopMusic();

                        ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setStageAndColor(1, ProgressObject.PlayerColor.BLUE));
                        executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);
                        mFadeParam = FADE_PARAM.START_GAME;
                    }
                }

                /*
                 */
            }
            else
            if (button == mButtonContinue)
            {
                //SoundManager.PlaySound(cSOUND_HIGHLIGHT);
                //mFade = new Fade(this, "fades\\blackfade");
                //executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);

                SoundManager.PlaySound(cSOUND_HIGHLIGHT);
                executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);
                mFadeParam = FADE_PARAM.CONTINUE_GAME;
            }
            else
            if (button == mButtonNewGame)
            {
                //SoundManager.PlaySound(cSOUND_HIGHLIGHT);
                //mFade = new Fade(this, "fades\\blackfade");
                //executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);
                SoundManager.PlaySound(cSOUND_HIGHLIGHT);

                ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setStageAndColor(1, ProgressObject.PlayerColor.BLUE));
                executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);
                mFadeParam = FADE_PARAM.START_GAME;
            }
            else if (button == mButtonHelp)
            {
                currentScreen = new HelpScreen(this);
                cSCREEN       = SCREENS.HELP_SCREEN;
                SoundManager.PlaySound(cSOUND_HIGHLIGHT);
                // Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_MAIN_MENU_HELP, false);
            }
            else if (button == mButtonCredits)
            {
                currentScreen = new CreditsScreen(this);
                cSCREEN       = SCREENS.CREDITS_SCREEN;
                SoundManager.PlaySound(cSOUND_HIGHLIGHT);
                //Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_MAIN_MENU_CREDITS, false);
            }
            else if (button == mButtonFullscreen)
            {
                SoundManager.PlaySound(cSOUND_HIGHLIGHT);
                Game1.getInstance().toggleFullscreen();
            }
            else if (button == mButtonExit)
            {
                executeFade(mFade, Fade.sFADE_OUT_EFFECT_GRADATIVE);
                mFadeParam = FADE_PARAM.EXIT_GAME;
            }
        }
Пример #5
0
 public virtual void fadeFinished(Fade fadeObject)
 {
 }
Пример #6
0
 public virtual void executeFade(Fade fadeObject, int effect)
 {
 }
Пример #7
0
        public MacroMapScreen()
        {
            if (!SoundManager.isPlaying())
            {
                //SoundManager.PlayMusic("sound\\music\\historia1");
            }

            mSpriteBatch = Game1.getInstance().getScreenManager().getSpriteBatch();


            mRectangleExhibitionTexture = new Rectangle(0, 0, 800, 600);

            //load resources

            //  mFade = new Fade(this, "fades\\blackfade");
            //executeFade(mFade, Fade.sFADE_IN_EFFECT_GRADATIVE);

            mCursor = new Cursor();
            mCursor.loadContent(Game1.getInstance().getScreenManager().getContent());

            mTextureBorder         = Game1.getInstance().getScreenManager().getContent().Load <Texture2D>("gameplay\\macromap\\mapaborda");
            mTexturePinoBussola    = Game1.getInstance().getScreenManager().getContent().Load <Texture2D>("gameplay\\macromap\\bussola_ponteiro_pino");
            mTextureBussola        = Game1.getInstance().getScreenManager().getContent().Load <Texture2D>("gameplay\\macromap\\bussola_bg");
            mTextureBussolaPointer = Game1.getInstance().getScreenManager().getContent().Load <Texture2D>("gameplay\\macromap\\bussola_ponteiro");

            mTimer = new MTimer(true);

            //ExtraFunctions.saveLevel(2);
            //Game1.print(" >>> " + ExtraFunctions.loadLevel().getCurrentStage());

            //Game1.progressObject.setCurrentStage(2);
            //ExtraFunctions.saveProgress(Game1.progressObject);

            if (ExtraFunctions.loadProgress().getCurrentStage() == 1)
            {
                //    Game1.print("AGAIN 1");
                //  setMacroMapState(MacroMapState.FirstStage);
                SoundManager.LoadSound(cSOUND_FALLING);
                setMacroMapState(MacroMapState.FirstStage);
            }
            if (ExtraFunctions.loadProgress().getCurrentStage() == 2)
            {
                setMacroMapState(MacroMapState.SecondStage);
            }
            if (ExtraFunctions.loadProgress().getCurrentStage() == 3)
            {
                setMacroMapState(MacroMapState.ThirdStage);
            }
            if (ExtraFunctions.loadProgress().getCurrentStage() == 4)
            {
                setMacroMapState(MacroMapState.FourthStage);
            }
            if (ExtraFunctions.loadProgress().getCurrentStage() == 5)
            {
                setMacroMapState(MacroMapState.Finish);
            }

            setMacroMapState(MacroMapState.SecondStage);

            //setMacroMapState(MacroMapState.Finish);

            SoundManager.PlayMusic(cMUSIC_MAP);

            mFade = new Fade(this, "fades\\blackfade", Fade.SPEED.FAST);

            executeFade(mFade, Fade.sFADE_IN_EFFECT_GRADATIVE);

            mTextureClickToStart = Game1.getInstance().getScreenManager().getContent().Load <Texture2D>("mainmenu\\clicktoskip");

            mTimerBlinkText = new MTimer(true);
        }