Exemplo n.º 1
0
 public static void NextLevel()
 {
     NextLevelIndex = LevelIndex + 1;
     NextState = Engine.States[(int)StateType.Game];
     EngineRef.Fade (255, 0, 0.75f);
     EngineRef.music.FadeOut (0.75f);
     LevelIndex++;
     (CurrentState as GameState).selectingRobot = true;
 }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            graphics.PreferredBackBufferWidth = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            graphics.SynchronizeWithVerticalRetrace = false;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();

            States.Add(new TitleState());
            States.Add(new GameState());
            States.Add(new CreditState());

            //SetState (StateType.Game);
            CurrentState = Engine.States[(int)StateType.Title];
            base.Initialize();
        }
Exemplo n.º 3
0
        private void UpdateFade(GameTime gameTime)
        {
            fadeTimePassed += (float)gameTime.ElapsedGameTime.TotalSeconds;

            if (fadeTimePassed >= fadeTimeTotal)
            {
                fading = false;

                if (Engine.NextState != null)
                {
                    if (NextState == States[(int)StateType.Title])
                        ResetGame ();

                    Engine.NextState.Activate();
                    Engine.CurrentState = Engine.NextState;
                    Engine.NextState = null;

                    // Go to the next level
                    if (Engine.NextLevelIndex != Engine.LevelIndex)
                        LevelIndex = NextLevelIndex;

                    Fade (0, 255, 0.75f);
                    EngineRef.music.PlayMusic ("Song1");
                    EngineRef.music.FadeIn (1.5f);
                }
            }
        }
Exemplo n.º 4
0
 public static void SetState(StateType state)
 {
     NextState = Engine.States[(int)state];
     EngineRef.Fade (255, 0, 0.75f);
     EngineRef.music.FadeOut (0.75f);
 }