コード例 #1
0
        public frmMain()
        {
            InitializeComponent();

            this.FormClosed += new FormClosedEventHandler(Form1_FormClosed);

            _data = new GameData(_numOpponents, 1);

            this.SetStyle(
              ControlStyles.AllPaintingInWmPaint |
              ControlStyles.UserPaint |
              ControlStyles.DoubleBuffer, true);

            _state = GameState.NotPlaying;

            _rocketQueue.setCanvas(Size);

            //_rocketQueue = new RocketQueue(new Random(), Size);

            _direction = Hand.PlayDirection.Forward;

            _gameLoopThread = new System.Threading.Thread(GameLoop);
            _gameLoopThread.Start();

            _tableCenter = Size.Width / 2;
        }
コード例 #2
0
        private void InitializeGame()
        {
            StopFireworksThread();

            for (int i = 0; i < _scores.Length; i++)
            {
                _scores[i] = 0;
            }

            _currentPlayer = _startingPlayer = 0;

            _data = new GameData(_numOpponents, 2);
        }