Esempio n. 1
0
 //
 // Method: NewGame();
 //
 private void NewGame()
 {
     TetrixState = TetrixStateEnum.StoppedState;
     m_objEngine = new Engine(ROWS, COLS);
     m_intShape = m_objEngine.GetShape();
     m_intShapeHeight = m_objEngine.ShapeHeight;
     m_intShapeWidth = m_objEngine.ShapeWidth;
     timer1.Interval = TIMER_START;
     m_intScore = 0;
     m_intLevel = 1;
     m_intRowCount = 0;
     m_intShapeCount = 0;
     Refresh();
 }
Esempio n. 2
0
        //
        // Method: Rotate tetramino orientation left or right
        //
        public void Rotate(Engine.ShapeRotateEnum rotate)
        {
            int tmpInt = m_currentOrientation;

            switch (rotate)
            {
                case Engine.ShapeRotateEnum.RotateCounterClockwise:
                    tmpInt = (tmpInt + 3) % MAX_ORIENTATION;
                    break;

                case Engine.ShapeRotateEnum.RotateClockwise:
                    tmpInt = (tmpInt + 1) % MAX_ORIENTATION;
                    break;

                case Engine.ShapeRotateEnum.RotateNone:
                default:
                    throw new Exception("Invalid rotation orientation!");
            }

            m_currentOrientation = tmpInt;
        }