Esempio n. 1
0
    void Awake()
    {
        gsm = new GameStateMachine();

        gsm.Add(GameState.Roaming, new RoamingState());
        gsm.Add(GameState.Combat, new CombatState());

        gsm.Change(GameState.Roaming);
    }
Esempio n. 2
0
 protected override void Awake()
 {
     base.Awake();
     stateMachine.Clear();
     stateMachine.Add(Gamestateprocesser.INIT, new InGameInitState());
     stateMachine.Add(Gamestateprocesser.START, new InGameStartState());
     stateMachine.Add(Gamestateprocesser.GAMEMAIN, new InGameMainState());
     stateMachine.Add(Gamestateprocesser.RESULT, new InGameResultState());
 }
Esempio n. 3
0
        /// <summary>
        /// First loading sequence.. only called once from ApplicationBase:Load()
        /// </summary>
        /// <returns>returns true if load is succesful</returns>
        public override bool OnFirstLoad()
        {
            Logger.Log("\n*** -- BEGIN LOADING -- ***\n");

            // SETS THE DEFAULT STARTING SEARCH DIRECTORY
            // BASED ON THE GAME BEING PLAYED....
            //            FileSearch.SetStartingSearchDirectory(FileSearch.GetApplicationDirectory() + "\\Media\\");

            almMachineStatus.Enable();
            try
            {
                MultiMediaLoader ml = new MultiMediaLoader("Bingo");
                ml.LoadFile("Bingo.txt");

                guiManager.Add(ml);
                ////////////////////////////////////////  un-Comment out for testing
                //                lblFps = (GuiLabel)guiManager.Get("lbl_fps");
                //                lblMessage = (GuiLabel)guiManager.Get("lbl_message");
                // add the 'StateLoading' state top the Bingo.stateMachine
                stateMachine.Add(new StateLoading(stateMachine));
                // change to (display) the 'Loading' state
                stateMachine.ChangeActiveState("Loading");
            }
            catch (Exception e)
            {
                Logger.Log("Exception Loading Loading State \n" + e.ToString());
                MessageBox.Show("Error Loading");
                return(false);
            }
            //            Logger.Log("Finished 'OnFirstLoad()' \n");
            return(true);
        }
Esempio n. 4
0
        public override string OnUpdate(Keyboard keyboard, Mouse mouse, GameCore.Timing.Timer timer)
        {
            if (!Bingo.instance.TopMost)
            {
                Bingo.instance.TopMost = true;
            }
            switch (loadingPart)  // "...Loading Sounds..."
            {
            case 0: lblAction.Text = "...Loading Sounds...";
                break;

            case 1: mediaObjs.LoadFile("Sounds.txt"); lblAction.Text = "...Loading Fonts...";
                break;

            case 2: mediaObjs.LoadFile("Fonts.txt"); lblAction.Text = "...Loading Animations...";
                break;

            case 3: mediaObjs.LoadFile("Animations.txt"); lblAction.Text = "...Loading Bitmaps...";
                break;

            case 4: mediaObjs.LoadFile("Bitmaps.txt"); lblAction.Text = "...Loading Main State...";
                break;

            case 5: stateMachine.Add(new StateMain());
                break;

/*
 *              case 6: stateMachine.Add(new StateTitle()); lblAction.Text = "...Loading PIN State...";
 *                  break;
 *              case 7: stateMachine.Add(new StatePIN()); lblAction.Text = "...Loading Main State...";
 *                  break;
 *              case 8: stateMachine.Add(new StateDemo()); lblAction.Text = "...Loading Attraction State...";
 *                  break;
 *              case 9: stateMachine.Add(new StateAttraction()); lblAction.Text = "...Loading Game Menu State...";
 *                  break;
 *              case 10: stateMachine.Add(new StateGameMenu());
 *                  break;
 */
            default:
            {
                return("Main");
            }
            }

            loadingPart++;

            guiManager.Update(keyboard, mouse, timer);
            return("NoChange");
        }