Пример #1
0
 void Update()
 {
     if (Input.GetKeyDown("space"))
     {
         currentGameState = GamesState.inTheGame;
     }
 }
Пример #2
0
 public void SetScreen(GamesState GameState)
 {
     CurrentState = GameState;
     if (CurrentState == GamesState.Gameplay)
     {
         StartGame();
     }
 }
Пример #3
0
 private void DoReset()
 {
     positionsSelected = new List <int>();
     timer             = 0;
     countDeadPlayers  = 0;
     currentGameState  = GamesState.RUNNING;
     InitializeAgents();
 }
Пример #4
0
 public void StartWatcher()
 {
     lock (_gameStateLock)
     {
         if (GamesState != GamesState.Running)
         {
             _timer     = new Timer(UpdateAtBats, null, _updateInterval, _updateInterval);
             GamesState = GamesState.Running;
             BroadcastGamesStateChange(GamesState.Running);
         }
     }
 }
 public void StartWatcher()
 {
     lock (_gameStateLock)
     {
         if (GamesState != GamesState.Running)
         {
             _timer = new Timer(UpdateAtBats, null, _updateInterval, _updateInterval);
             GamesState = GamesState.Running;
             BroadcastGamesStateChange(GamesState.Running);
         }
     }
 }
        public void PauseWatcher()
        {
            lock (_gameStateLock)
            {
                if (GamesState == GamesState.Running)
                {
                    if (_timer != null)
                        _timer.Dispose();

                    GamesState = GamesState.Paused;
                    BroadcastGamesStateChange(GamesState.Paused);
                }
            }
        }
Пример #7
0
        public void PauseWatcher()
        {
            lock (_gameStateLock)
            {
                if (GamesState == GamesState.Running)
                {
                    if (_timer != null)
                    {
                        _timer.Dispose();
                    }

                    GamesState = GamesState.Paused;
                    BroadcastGamesStateChange(GamesState.Paused);
                }
            }
        }
Пример #8
0
        private void BroadcastGamesStateChange(GamesState state)
        {
            switch (state)
            {
            case GamesState.Paused:
                Clients.All.gamesPaused();
                break;

            case GamesState.Running:
                Clients.All.gamesRunning();
                break;

            default:
                break;
            }
        }
Пример #9
0
    void ChangeGameState(GamesState newGamesState)
    {
        switch (newGamesState)
        {
        case GamesState.nemu:
            //la esene debera mostrar el menu principal
            break;

        case GamesState.inTheGame:
            //debe configurarse para mostrar el juego
            break;

        case GamesState.gameOver:
            //la esena debe mostar la pantalla de fin de partida
            break;

        default:
            break;
        }
    }
Пример #10
0
 void Start()
 {
     currentGameState = GamesState.nemu;
 }
Пример #11
0
 private void ResetEnviroment()
 {
     currentGameState = GamesState.RESETTING;
     timer            = 0;
 }
Пример #12
0
 private void BroadcastGamesStateChange(GamesState state)
 {
     switch (state)
     {
         case GamesState.Paused:
             Clients.All.gamesPaused();
             break;
         case GamesState.Running:
             Clients.All.gamesRunning();
             break;
         default:
             break;
     }
 }