Example #1
0
 public StateFactory()
 {
     //Don't show transition screen if it's our first load.
     isTransitionDone   = true;
     isSceneLoaded      = false;
     m_transitionScreen = GameObject.Find("TransitionScreen").GetComponent <TransitionScreen>();
 }
Example #2
0
 public new void Start()
 {
     base.Start();
     loadingScreen = this.GetTransitionScreen();
     if (loadingScreen.LoadingScreenIsOpen())
     {
         StartCoroutine(loadingScreen.FadeOutBlackScreen());
     }
 }
Example #3
0
 void Jouer8(object sender, EventArgs e)
 {
     foreach (GameScreen screen in ScreenManager.GetScreens())
     {
         screen.ExitScreen();
     }
     TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new Element_mode(8));
     song = new Song_Management(this.ScreenManager);
     song.Change_Ingame();
 }
Example #4
0
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new MainMenuScreen());
            }

            if (_nouvelle_partie)
            {
                NouvellePartie();
            }

            timer = (float)gameTime.ElapsedGameTime.TotalMilliseconds;

            transition.UpdateAlpha(timer);

            UpdateClavier();
            KeyboardAdd();

            if (_transition_keyboard)
            {
                TransitionPerduGagner(timer);
            }

            if (_validation_mot)
            {
                ValiderVerificationLettre(liste_mot.ElementAt(_position_verification_mot), timer);
            }
            if (_mot_faux)
            {
                MotInvalide_PasserSuivant();
            }
            if (_timer_attente)
            {
                PerduAffichageSolution(timer);
            }
            if (_animation_mot_juste)
            {
                AnimMotJuste(timer);
            }
            if (_type_partie == TypeDePartie.Montre && !_temps_ecoule)
            {
                Timer(timer);
            }
            if (_motfauxmontre)
            {
                TimerMontreMotFaux(timer);
            }
            if (_mot_faux_affichage_animation)
            {
                TimerAnimationMotFaux(timer);
            }

            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }
        public ConnectCASController(TransitionScreen view,
                                    CityConnectionRegulator cityConnectionRegulator)
        {
            View = view;
            CityConnectionRegulator = cityConnectionRegulator;
            CityConnectionRegulator.OnTransition += CityConnectionRegulator_OnTransition;
            CityConnectionRegulator.OnError      += CityConnectionRegulator_OnError;

            View.ShowProgress = true;
            View.SetProgress(0, 4);
        }
Example #6
0
        public DisconnectController(TransitionScreen view, CityConnectionRegulator cityRegulator, LotConnectionRegulator lotRegulator, Network.Network network)
        {
            View = view;
            View.ShowProgress = false;

            network.LotClient.Disconnect();
            network.CityClient.Disconnect();
            CityConnectionRegulator = cityRegulator;
            CityConnectionRegulator.OnTransition += CityConnectionRegulator_OnTransition;
            LotConnectionRegulator = lotRegulator;
        }
Example #7
0
    // Use this for initialization
    void Start()
    {
        // Take stuff from the story here and initialize it
        gameHasStarted  = false;
        gameEndApproved = false;
        GameObject temp = Instantiate(StoryDisplayer);

        temp.GetComponent <StoryDisplay>().Initializer  = Initializer;
        temp.GetComponent <TransitionScreen>().MasterUI = MasterUI;
        endGameReference = temp.GetComponent <TransitionScreen>();
        endGameReference.displayPostGameScreen = displyPostGameStats;
    }
Example #8
0
        public DisconnectController(TransitionScreen view, CityConnectionRegulator cityRegulator, LotConnectionRegulator lotRegulator, LoginRegulator logRegulator, Network.Network network)
        {
            View = view;
            View.ShowProgress = false;

            CityConnectionRegulator = cityRegulator;
            CityConnectionRegulator.OnTransition += CityConnectionRegulator_OnTransition;
            LotConnectionRegulator       = lotRegulator;
            LoginRegulator               = logRegulator;
            LoginRegulator.OnError      += LoginRegulator_OnError;
            LoginRegulator.OnTransition += LoginRegulator_OnTransition;
        }
Example #9
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
Example #10
0
        public override void HandleInput(InputState input)
        {
            foreach (GestureSample gesture in input.Gestures)
            {
                if (gesture.GestureType == GestureType.Tap)
                {
                    if (keyboard.liste_lettre[0].Alpha == 1)
                    {
                        foreach (Keyboard_Lettre caca in keyboard.liste_lettre)
                        {
                            if (caca.HandleTap(gesture.Position))
                            {
                                keyboard._letter_tapped = caca._lettre;
                                keyboard._tapped        = true;
                                keyboard._type_tapped   = caca._type;
                                break;
                            }
                        }
                    }
                    if (optionFinPartie.Alpha == 1)
                    {
                        if (_type_partie == TypeDePartie.Simple)
                        {
                            if (optionFinPartie.HandleTapMenu(gesture.Position))
                            {
                                TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new MainMenuScreen());
                            }

                            if (optionFinPartie.HandleTapRejouer(gesture.Position))
                            {
                                TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new InGame.Motus(_facile, TypeDePartie.Simple));
                            }
                        }
                        else
                        {
                            if (optionFinPartie.HandleTapScore(gesture.Position))
                            {
                                TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new ScoreScreen(_type_partie, _nombre_de_point));
                            }

                            if (optionFinPartie.HandleTapRejouer(gesture.Position))
                            {
                                TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new InGame.Motus(_facile, _type_partie));
                            }
                        }
                    }
                }
            }

            base.HandleInput(input);
        }
Example #11
0
        public RandomTransition(ScreenManager sceneManager) : base(sceneManager)
        {
            list = new List <TransitionScreen>();
            list.Add(new Fade(sceneManager));
            list.Add(new Slide(sceneManager, Way.Down));
            list.Add(new Slide(sceneManager, Way.Up));
            list.Add(new Slide(sceneManager, Way.Right));
            list.Add(new Slide(sceneManager, Way.Left));
            list.Add(new Flash(sceneManager));
            list.Add(new Pixelize(sceneManager));
            list.Add(new Doors(sceneManager, Direction.Vertical));
            list.Add(new Doors(sceneManager, Direction.Horizontal));

            t = list[RandomHelper.RandomInt(0, list.Count)];
        }
        public RandomTransition(ScreenManager sceneManager)
            : base(sceneManager)
        {
            list = new List<TransitionScreen>();
            list.Add(new Fade(sceneManager));
            list.Add(new Slide(sceneManager, Way.Down));
            list.Add(new Slide(sceneManager, Way.Up));
            list.Add(new Slide(sceneManager, Way.Right));
            list.Add(new Slide(sceneManager, Way.Left));
            list.Add(new Flash(sceneManager));
            list.Add(new Pixelize(sceneManager));
            list.Add(new Doors(sceneManager, Direction.Vertical));
            list.Add(new Doors(sceneManager, Direction.Horizontal));

            t = list[RandomHelper.RandomInt(0, list.Count)];
        }
Example #13
0
 // Start is called before the first frame update
 void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
         return;
     }
     anim            = GetComponent <Animator>();
     fade_hash       = Animator.StringToHash("Fade");
     start_fade_hash = Animator.StringToHash("StartFade");
     DontDestroyOnLoad(gameObject);
 }
Example #14
0
 public TransitionScreen GetTransitionScreen()
 {
     if (GameObject.Find("TransitionScreen") == null)
     {
         Debug.LogError("Impossible de trouver l'objet TransitionScreen dans la scène");
         return(null);
     }
     else
     {
         TransitionScreen o = GameObject.Find("TransitionScreen").GetComponent <TransitionScreen>();
         if (!o.isStart)
         {
             o.Start();
         }
         return(o);
     }
 }
Example #15
0
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                if (visualisation)
                {
                    this.ExitScreen();
                    ScreenManager.AddScreen(new ScoreVisualisation_TypePartie());
                }
                else
                {
                    TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new MainMenuScreen());
                }
            }
            if (!multi.HighScoreLoaded)
            {
                _timeloading += (float)gameTime.ElapsedGameTime.TotalMilliseconds;
                Loading(_timeloading);
            }

            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }
Example #16
0
        public static void StartNewTransitionScreen(this Game game)
        {
            TransitionScreen transition = null;
            if (first_transition != true)
                transition = new TransitionScreen(game);

            if (first_transition != true)
            {
                game.Components.Add(transition);

                transition.OnTransitionStart += () =>
                {
                    for (int i = 0; i < game.Components.Count; i++)
                    {
                        GameComponent gc = (GameComponent)game.Components[i];
                        if (gc != transition)
                            gc.Enabled = false;
                    }
                };

                transition.OnTransitionEnd += () =>
                {
                    for (int i = 0; i < game.Components.Count; i++)
                    {
                        GameComponent gc = (GameComponent)game.Components[i];
                        if (gc != transition)
                            gc.Enabled = true;
                        else
                        {
                            game.Components.RemoveAt(i);
                            i--;
                        }
                    }
                };
            }

            first_transition = false;
        }
        private void InitScreen()
        {
            var playscreen = new MainPlayScreen(GraphicsDevice)
            {
                MapName = CONTENT_MANAGER.MapName ?? "menu"
            };

            TransitionScreen transitionScreen = new TransitionScreen(GraphicsDevice)
            {
                StartingDirectory = Path.Combine(CONTENT_MANAGER.LocalRootPath, "map"),
                SearchPattern     = "*.tmx",
                CallBack          = x => {
                    playscreen.MapName = x;
                    SCREEN_MANAGER.GotoScreen("MainPlayScreen");
                }
            };

            SCREEN_MANAGER.AddScreen(playscreen);
            SCREEN_MANAGER.AddScreen(transitionScreen);

            SCREEN_MANAGER.GotoScreen("MainPlayScreen");

            SCREEN_MANAGER.Init();
        }
Example #18
0
 public Game(GameScreen gameScreen, TransitionScreen transitionScreen)
 {
     this.gameScreen       = gameScreen;
     this.transitionScreen = transitionScreen;
 }
Example #19
0
 // Use this for initialization
 void Start()
 {
     StartCoroutine(timer());
     time       += 1;
     GameManager = GameObject.Find("Transition Screen").GetComponent <TransitionScreen>();
 }
Example #20
0
 public new void Start()
 {
     base.Start();
     loadingScreen = this.GetTransitionScreen();         // Auto créé s'il n'existe pas
 }
Example #21
0
 public RandomTransition(ScreenManager sceneManager, List <TransitionScreen> list) : base(sceneManager)
 {
     t = list[RandomHelper.RandomInt(0, list.Count)];
 }
Example #22
0
 // Use this for initialization
 void Start()
 {
     GameManager = GameObject.Find("Transition Screen").GetComponent <TransitionScreen>();
 }
Example #23
0
 // Use this for initialization
 void Start()
 {
     encolere = false;
     scolere.SetActive(false);
     GameManager = GameObject.Find("Transition Screen").GetComponent <TransitionScreen>();
 }
 public RandomTransition(ScreenManager sceneManager, List<TransitionScreen> list)
     : base(sceneManager)
 {
     t = list[RandomHelper.RandomInt(0, list.Count)];
 }
Example #25
0
 void Awake()
 {
     transitionScreen = GetComponent <TransitionScreen>();
     transitionText   = GetComponent <TransitionText>();
 }
Example #26
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // TODO: Add your update logic here

            // Updates keyboard and mouse states
            Globals.UpdateGlobals();

            // If there is a fade active, no other update code is run
            // If the game is paused, no other update code is run and there is a check to see if the player has left it. If the help screen is open, it runs that logic.
            // Otherwise, it runs the logic for the current mode.
            if (Globals.Fade.Active)
            {
                Globals.Fade.Update();
            }
            else if (paused)
            {
                // Checks if the player unpauses, or if they press the menu button
                if (Globals.CheckKey(Keys.Escape))
                {
                    paused = false;
                }
                else if (menuBtn.CheckButton())
                {
                    Globals.Fade.Start(Globals.MENU, 1);
                    paused = false;
                }
            }
            else if (Globals.HelpScreenOpen)
            {
                HelpScreen.Update();
            }
            else
            {
                switch (Globals.Gamestate)
                {
                case Globals.LOGO:
                {
                    // Once the logo has lasted for its entire duration, the fade to the menu begins
                    if (logoDuration.CheckCooldown())
                    {
                        Globals.Fade.Start(Globals.MENU, 1);
                    }
                    else
                    {
                        logoDuration.UpdateCooldown();
                    }
                    break;
                }

                case Globals.TRANSITION:
                {
                    TransitionScreen.Update();
                    break;
                }

                case Globals.MENU:
                {
                    Menu.Update();
                    break;
                }

                case Globals.GAMEPLAY:
                {
                    // Checks if the player has paused
                    if (Globals.CheckKey(Keys.Escape))
                    {
                        paused = true;
                    }

                    // Updates the game that is currently running
                    switch (Globals.Minigame)
                    {
                    case Globals.LUCKY_DAY:
                    {
                        luckyDay.Update();
                        break;
                    }

                    case Globals.COLOR_GUESSER:
                    {
                        colorGuesser.Update();
                        break;
                    }

                    case Globals.RAINDROPS:
                    {
                        raindrops.Update();
                        break;
                    }

                    case Globals.JUGGLER:
                    {
                        juggler.Update();
                        break;
                    }

                    case Globals.TERMINAL_VELOCITY:
                    {
                        terminalVelocity.Update();
                        break;
                    }

                    case Globals.BACKWARDS:
                    {
                        backwards.Update();
                        break;
                    }

                    case Globals.TYPEWRITER:
                    {
                        typewriter.Update();
                        break;
                    }

                    case Globals.FLOOR_IS_LAVA:
                    {
                        floorIsLava.Update();
                        break;
                    }

                    case Globals.MILKSHAKER:
                    {
                        milkshaker.Update();
                        break;
                    }

                    case Globals.CIRCLE_CLICKER:
                    {
                        circleClicker.Update();
                        break;
                    }
                    }
                    break;
                }

                case Globals.LEADERBOARD:
                {
                    Leaderboard.Update();
                    break;
                }

                case Globals.RESULTS:
                {
                    Results.Update();
                    break;
                }
                }
            }
            base.Update(gameTime);
        }
Example #27
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            // TODO: Add your drawing code here

            spriteBatch.Begin();

            switch (Globals.Gamestate)
            {
            case Globals.LOGO:
            {
                // Draws the logo
                spriteBatch.Draw(logoImg, new Rectangle(300, 360, 600, 80), Color.White);
                break;
            }

            case Globals.MENU:
            {
                Menu.Draw(spriteBatch, gameTime);
                break;
            }

            case Globals.TRANSITION:
            {
                TransitionScreen.Draw(spriteBatch);
                break;
            }

            case Globals.GAMEPLAY:
            {
                // Draws the assets of the appropriate game
                switch (Globals.Minigame)
                {
                case Globals.LUCKY_DAY:
                {
                    luckyDay.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.COLOR_GUESSER:
                {
                    colorGuesser.Draw(spriteBatch);
                    break;
                }

                case Globals.RAINDROPS:
                {
                    raindrops.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.JUGGLER:
                {
                    juggler.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.TERMINAL_VELOCITY:
                {
                    terminalVelocity.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.BACKWARDS:
                {
                    backwards.Draw(spriteBatch);
                    break;
                }

                case Globals.TYPEWRITER:
                {
                    typewriter.Draw(spriteBatch);
                    break;
                }

                case Globals.FLOOR_IS_LAVA:
                {
                    floorIsLava.Draw(spriteBatch, gameTime);
                    break;
                }

                case Globals.MILKSHAKER:
                {
                    milkshaker.Draw(spriteBatch);
                    break;
                }

                case Globals.CIRCLE_CLICKER:
                {
                    circleClicker.Draw(spriteBatch);
                    break;
                }
                }

                // Draws the hud elements
                Hud.Draw(spriteBatch);
                break;
            }

            case Globals.RESULTS:
            {
                Results.Draw(spriteBatch);
                break;
            }

            case Globals.LEADERBOARD:
            {
                Leaderboard.Draw(spriteBatch);
                break;
            }
            }

            // Draws the help screen if it is open
            if (Globals.HelpScreenOpen && !Globals.Fade.Active)
            {
                HelpScreen.Draw(spriteBatch);
            }

            // Draws the pause screen if it is active
            if (paused)
            {
                spriteBatch.Draw(blankRecImg, Globals.GetRec(), Color.Black * pausedOpacity);
                spriteBatch.DrawString(bigFont, "PAUSED", Globals.CentreText(Globals.GetRec(), "PAUSED", bigFont), Color.White);

                spriteBatch.Draw(menuBtn.Img, menuBtn.Rec, Color.White);
            }

            // Draws the fade if it is active
            if (Globals.Fade.Active)
            {
                Globals.Fade.Draw(spriteBatch);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }
Example #28
0
 private void Start()
 {
     win         = 0;
     QTEGen      = Random.Range(1, 4);
     GameManager = GameObject.Find("Transition Screen").GetComponent <TransitionScreen>();
 }
Example #29
0
 // Use this for initialization
 void Start()
 {
     JaugeVise.value = i;
     GameManager     = GameObject.Find("Transition Screen").GetComponent <TransitionScreen>();
 }