public static Game RunGame(int number) { switch (number) { case 1: var state1 = new GameState1(); return(new Game(800, 600, Phaser.AUTO, "phaserRoot", state1)); case 2: var state2 = new GameState2(); return(new Game(800, 600, Phaser.AUTO, "phaserRoot", state2)); case 3: var state3 = new GameState3(); return(new Game(800, 600, Phaser.AUTO, "phaserRoot", state3)); case 4: var state4 = new GameState4(); return(new Game(700, 300, Phaser.CANVAS, "phaserRoot", state4)); default: throw new ArgumentOutOfRangeException(nameof(number)); } }
void GameOver() { // pause time. Time.timeScale = 0.0f; // destroy player. Destroy(playerTransform.gameObject); gameState = GameState1.gameover; }
public Game(int limit) { Random random = new Random(DateTime.Now.Millisecond); int number = random.Next(1, limit); questions.Add(number); gameState = Memorize.GameState1.Questioning; }
void GameStateChangedEvent(GameState1 currentState) { if (currentState == GameState1.Main) { SetUIToMainScreen(); } else if (currentState == GameState1.Options) { SetUIToOptionsScreen(); } else if (currentState == GameState1.Phone) { SetsUIToPhoneScreen(); } }
void Start() { // realtime speed. Time.timeScale = 1.0f; gameState = GameState1.playing; }