Beispiel #1
0
        private void updateMouseInput()
        {
            var ms = Game1.getMousePosition();

            if (ms.LeftButton == ButtonState.Pressed)
            {
                if (oldStateMouse.LeftButton != ButtonState.Pressed)
                {
                    if (mCurrentSelectableCharacter != null)
                    {
                        if (mCurrentSelectableCharacter == mSelectableCharacterRed)
                        {
                            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setColor(ProgressObject.PlayerColor.RED));
                        }
                        else
                        if (mCurrentSelectableCharacter == mSelectableCharacterGreen)
                        {
                            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setColor(ProgressObject.PlayerColor.GREEN));
                        }
                        else
                        if (mCurrentSelectableCharacter == mSelectableCharacterBlue)
                        {
                            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setColor(ProgressObject.PlayerColor.BLUE));
                        }

                        mCurrentSelectableCharacter.changeState(SelectableCharacter.sSTATE_SELECTED);
                        mReduceAlpha = true;

                        mTimerAfterSelection = new MTimer(true);
                    }
                }
            }

            oldStateMouse = ms;
        }
Beispiel #2
0
        public Balloon(Color color, Vector2 origin, BTYPE type)
            : base()
        {
            mType = type;

            mTimerChangeColor = new MTimer(true);

            enemyColor = color;

            if (mType == BTYPE.INSTANT_BALLOON)
            {
                mSpriteRed   = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 12, "enemies\\balloon\\red\\red"), new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, 1, 100, 100, false, false);
                mSpriteGreen = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 12, "enemies\\balloon\\green\\green"), new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, 1, 100, 100, false, false);
                mSpriteBlue  = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 12, "enemies\\balloon\\blue\\blue"), new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, 1, 100, 100, false, false);
            }
            else
            if (mType == BTYPE.HEART)
            {
                /*hmSpriteRed = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 12, "enemies\\balloon\\red\\red"), new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, 1, 100, 100, false, false);
                 * mSpriteGreen = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 12, "enemies\\balloon\\green\\green"), new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, 1, 100, 100, false, false);
                 * mSpriteBlue = new Sprite(ExtraFunctions.fillArrayWithImages2(1, 12, "enemies\\balloon\\blue\\blue"), new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, 1, 100, 100, false, false);*/
            }

            addSprite(mSpriteRed, sSTATE_FLYING_RED);
            addSprite(mSpriteGreen, sSTATE_FLYING_GREEN);
            addSprite(mSpriteBlue, sSTATE_FLYING_BLUE);

            changeToSprite(sSTATE_FLYING_RED);

            setCollisionRect(15, 15, 70, 70);
            setLocation(origin);
        }
Beispiel #3
0
        private void updateTimer(GameTime gameTime)
        {
            if (mTimer != null)
            {
                mTimer.update(gameTime);

                if (mTimer.getTimeAndLock(cEVENT_SECONDS))
                {
                    if (mActiveInsideButton)
                    {
                        mEventCompleted = true;

                        mTimer.stop();
                        mTimer = null;
                    }
                }
            }


            if (mTimerParalyzed != null)
            {
                mTimerParalyzed.update(gameTime);

                if (mTimerParalyzed.getTimeAndLock(0.6))
                {
                    mTimerParalyzed.stop();
                    mTimerParalyzed = null;

                    mCanMove = true;
                }
            }
        }
Beispiel #4
0
        public StoryScreen()
        {
            mVideo = Game1.getInstance().getScreenManager().getContent().Load <Video>("story\\videos\\Story");

            mVideoPlayer = new VideoPlayer();
            mVideoPlayer.Play(mVideo);


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

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

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

            mTimer = new MTimer(true);

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

            mTimerBlinkText = new MTimer(true);

            mButtonSkip = new Button("gameplay\\macromap\\PularSkip2", "gameplay\\macromap\\PularSkip2", "gameplay\\macromap\\PularSkip2", new Rectangle(392, 485, 419, 113));
            mButtonSkip.loadContent(Game1.getInstance().getScreenManager().getContent());
        }
Beispiel #5
0
 public void paralyze()
 {
     if (mCanMove)
     {
         mTimerParalyzed = new MTimer(true);
         mCanMove        = false;
     }
 }
Beispiel #6
0
 public void restartTimeInterval(int interval)
 {
     if (mTimeIntervalBetweenEnemies != interval)
     {
         mTimeIntervalBetweenEnemies = interval;
         mTimer = new MTimer(true);
     }
 }
Beispiel #7
0
        private void restartTimer(int seconds)
        {
            /*mTimer = new Timer();
             * mTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
             * mTimer.Interval = seconds * 1000;
             * mTimer.Enabled = true;*/

            mTimer = new MTimer();
            mTimer.start();
        }
Beispiel #8
0
        private void goToGameScreen()
        {
            if (mTimer != null)
            {
                mTimer.stop();
                mTimer = null;
            }

            Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_CHAR_SELECTION, true, true);
        }
Beispiel #9
0
        private void goToMainMenu()
        {
            ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setCurrentStage(1));

            if (mTimer != null)
            {
                mTimer.stop();
                mTimer = null;
            }

            mVideoPlayer.Stop();
            Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_MAIN_MENU, true, true);
        }
Beispiel #10
0
        public void hurt()
        {
            if (!mHurt)
            {
                mHurt = true;
                mTimerTotalHurtTime = new MTimer();
                mTimerTotalHurtTime.start();

                mTimerBlinkSpeed = new MTimer();
                mTimerBlinkSpeed.start();

                mData.removeEnergy();
            }
        }
Beispiel #11
0
        public SplashScreen()
        {
            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[1] {
                "mainmenu\\MainMenu_mato01"
            }, 1, 232, 111, 0, 600 - 111);
            mBackgroundImage.addPart(new String[1] {
                "mainmenu\\MainMenu_mato02"
            }, 1, 345, 135, 800 - 345, 600 - 95);

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

            mList.Add(mBackgroundImage);

            mCurrentBackground = mList.ElementAt(0);

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

            mGamelogo        = Game1.getInstance().getScreenManager().getContent().Load <Texture2D>("mainmenu\\logo");
            mBlackBackground = Game1.getInstance().getScreenManager().getContent().Load <Texture2D>("fades\\blackfade");

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

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

            SoundManager.LoadSound(cSOUND_HIGHLIGHT);

            mTimer = new MTimer(true);
        }
Beispiel #12
0
        private void updateTimer(GameTime gameTime)
        {
            if (mTimer != null)
            {
                mTimer.update(gameTime);

                if (mTimer.getTimeAndLock(1))
                {
                    mIncreaseAlpha = true;
                }
                if (mTimer.getTimeAndLock(3))
                {
                    mShowBlackBackground = false;
                    executeFade(mFade, Fade.sFADE_IN_EFFECT_GRADATIVE);
                }
                if (mTimer.getTimeAndLock(4))
                {
                    mTimerBlinkText = new MTimer(true);
                }
            }
        }
Beispiel #13
0
        public EndingScreen()
        {
            mVideo       = Game1.getInstance().getScreenManager().getContent().Load <Video>("story\\videos\\ENDING_WITH_MUSIC");
            mVideoPlayer = new VideoPlayer();

            mVideoPlayer.Play(mVideo);

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

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

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

            mTimer = new MTimer(true);

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

            mTimerBlinkText = new MTimer(true);
        }
Beispiel #14
0
 private void restartTimer()
 {
     mTimer = new MTimer();
     mTimer.start();
 }
Beispiel #15
0
 public void start()
 {
     mTimer = new MTimer();
     mTimer.start();
 }
Beispiel #16
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);
        }
Beispiel #17
0
        private void updateTimer(GameTime gameTime)
        {
            if (mTimer != null)
            {
                mTimer.update(gameTime);

                if (mCurrentMacroMapState == MacroMapState.FirstStage)
                {
                    if (mTimer.getTimeAndLock(1))
                    {
                        Game1.print("stage1");
                        mStartFeatures = true;
                        SoundManager.PlaySound(cSOUND_FALLING);
                    }

                    if (mTimer.getTimeAndLock(4))
                    {
                        mMacromapPlayer.setVisible(true);
                        mMacromapPlayer.growUp(0.1f);
                        mTimerBlinkText = new MTimer(true);
                    }
                }
                if (mCurrentMacroMapState == MacroMapState.SecondStage)
                {
                    Game1.print("stage2");
                    //explode cenario
                    if (mTimer.getTimeAndLock(1))
                    {
                        mBackgroundBefore = null;
                        mExplosionManager.getNextOfColor(Color.Red).explode(200, 140);
                        mExplosionManager.getNextOfColor(Color.Green).explode(185, 205);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(109, 225);
                        mExplosionManager.getNextOfColor(Color.Red).explode(75, 316);
                        mExplosionManager.getNextOfColor(Color.Red).explode(144, 387);
                        mExplosionManager.getNextOfColor(Color.Green).explode(214, 344);
                        mExplosionManager.getNextOfColor(Color.Green).explode(102, 223);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(108, 143);
                        mExplosionManager.getNextOfColor(Color.Green).explode(131, 285);
                    }

                    //anda em direcao ao barco
                    if (mTimer.getTimeAndLock(3))
                    {
                        mMacromapPlayer.setDestiny(83, 117);
                        mMacromapPlayer.moveTo(new Vector2(83, 117));
                    }

                    //barco anda junto com jogador pra fora da tela
                    if (mTimer.getTimeAndLock(7))
                    {
                        mMacromapShip.setFlip(true);
                        mMacromapShip.moveTo(new Vector2(-180, (int)mMacromapShip.mY));

                        mMacromapPlayer.setDestiny(-180, (int)mMacromapShip.mY);
                        mMacromapPlayer.moveTo(new Vector2(-180, (int)mMacromapShip.mY));
                    }
                }
                if (mCurrentMacroMapState == MacroMapState.ThirdStage)
                {
                    //explode cenario
                    if (mTimer.getTimeAndLock(1))
                    {
                        mBackgroundBefore = null;
                        mExplosionManager.getNextOfColor(Color.Blue).explode(224, 10);
                        mExplosionManager.getNextOfColor(Color.Red).explode(185, 25);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(66, 75);
                        mExplosionManager.getNextOfColor(Color.Green).explode(243, 107);
                        mExplosionManager.getNextOfColor(Color.Red).explode(224, 10);
                        mExplosionManager.getNextOfColor(Color.Green).explode(185, 25);
                        mExplosionManager.getNextOfColor(Color.Red).explode(76, 473);
                        mExplosionManager.getNextOfColor(Color.Red).explode(355, 151);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(201, 477);
                        mExplosionManager.getNextOfColor(Color.Red).explode(52, 170);
                        mExplosionManager.getNextOfColor(Color.Green).explode(216, 205);
                        mExplosionManager.getNextOfColor(Color.Green).explode(229, 402);

                        mMacromapShip.setFlip(false);
                        mMacromapShip.moveTo(new Vector2(40, 465));
                    }

                    if (mTimer.getTimeAndLock(5))
                    {
                        mMacromapShip.setFlip(false);
                        mMacromapShip.moveTo(new Vector2(251, 335));
                    }

                    if (mTimer.getTimeAndLock(15))
                    {
                        mMacromapPlayer.moveTo(new Vector2(360, 285));
                    }
                }
                if (mCurrentMacroMapState == MacroMapState.FourthStage)
                {
                    //explode cenario
                    if (mTimer.getTimeAndLock(1))
                    {
                        mBackgroundBefore = null;
                        mExplosionManager.getNextOfColor(Color.Red).explode(387, 393);
                        mExplosionManager.getNextOfColor(Color.Green).explode(385, 55);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(409, 305);
                        mExplosionManager.getNextOfColor(Color.Red).explode(437, 123);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(600, 273);
                        mExplosionManager.getNextOfColor(Color.Red).explode(487, 512);
                        mExplosionManager.getNextOfColor(Color.Green).explode(651, 463);
                        mExplosionManager.getNextOfColor(Color.Red).explode(335, 489);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(260, 246);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(551, 362);
                        mExplosionManager.getNextOfColor(Color.Green).explode(479, 212);
                    }

                    if (mTimer.getTimeAndLock(5))
                    {
                        mMacromapPlayer.moveTo(new Vector2(629, 172));
                    }
                }

                if (mCurrentMacroMapState == MacroMapState.Finish)
                {
                    //explode cenario
                    if (mTimer.getTimeAndLock(1))
                    {
                        mBackgroundBefore = null;
                        mExplosionManager.getNextOfColor(Color.Red).explode(595, 69);
                        mExplosionManager.getNextOfColor(Color.Green).explode(600, 80);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(509, 100);
                        mExplosionManager.getNextOfColor(Color.Red).explode(537, 120);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(600, 135);
                        mExplosionManager.getNextOfColor(Color.Red).explode(587, 155);
                        mExplosionManager.getNextOfColor(Color.Green).explode(651, 200);
                        mExplosionManager.getNextOfColor(Color.Red).explode(700, 300);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(660, 350);
                        mExplosionManager.getNextOfColor(Color.Blue).explode(751, 400);
                        mExplosionManager.getNextOfColor(Color.Green).explode(639, 212);
                        mExplosionManager.getNextOfColor(Color.Red).explode(6665, 93);
                    }

                    if (mTimer.getTimeAndLock(5))
                    {
                        //mMacromapPlayer.moveTo(new Vector2(629, 172));
                    }
                }
            }

            if (mTimerBlinkText != null)
            {
                mTimerBlinkText.update(gameTime);

                if (mTimerBlinkText.getTimeAndLock(0.8f))
                {
                    mShowTextClickToStart = true;
                }
                if (mTimerBlinkText.getTimeAndLock(1.6f))
                {
                    mShowTextClickToStart = false;
                    mTimerBlinkText.start();
                }
            }
        }