コード例 #1
0
        /// <summary>
        /// Handles the CursorUp event.
        /// </summary>
        /// <param name="sender">Always null.</param>
        /// <param name="e">Data of event.</param>
        private void CursorUp_Handler(object sender, CursorUpArgs e)
        {
            // Exits the tile screen, changing the status of game.
            IRTGame game = this.Game as IRTGame;

            game.ChangeScreen(IRTGame.GameScreens.ConfigScreen);

            // Unregister this event dispatcher.
            InputManager.Instance.CursorUp -= this.CursorUp_Handler;
        }
コード例 #2
0
ファイル: GameScreen.cs プロジェクト: schalleneider/irtaktiks
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            IRTGame game = this.Game as IRTGame;

            // End the game.
            if (game.PlayerOne.Won || game.PlayerTwo.Won)
            {
                game.ChangeScreen(IRTGame.GameScreens.EndScreen);
            }

            base.Update(gameTime);
        }