Beispiel #1
0
        public override void nextState(ArchiTetris e)
        {
            e.currentBlock = e.rwl.getBlock();
            e.currentBlock.setBlocksPos(4, 1);
            FallingState newState = new FallingState(e);

            e.bState = newState;
        }
Beispiel #2
0
        public override void nextState(ArchiTetris e)
        {
            BoardState   newState;
            FallingState fState = new FallingState(e);

            newState   = (BoardState)fState;
            e.bState   = newState;
            e.lastMove = "";
        }
Beispiel #3
0
        private void rotateBlock()
        {
            FallingState fs = bState as FallingState;

            if (currentBlock != null && fs != null && lastMove.Equals(""))
            {
                // rotates block clockwise
                currentBlock.rotate(true);
                lastMove = "rotate";
                CheckState cState = new CheckState(this);
            }
        }
Beispiel #4
0
        private void moveRight()
        {
            FallingState fs = bState as FallingState;

            if (currentBlock != null && fs != null && lastMove.Equals(""))
            {
                // move block right
                currentBlock.setBlocksPos(currentBlock.getX() + 1, currentBlock.getY());
                lastMove = "right";
                CheckState cState = new CheckState(this);
            }
        }
Beispiel #5
0
        private void moveDown()
        {
            FallingState fs = bState as FallingState;

            if (currentBlock != null && fs != null && lastMove.Equals(""))
            {
                // move block down
                currentBlock.setBlocksPos(currentBlock.getX(), currentBlock.getY() + 1);
                lastMove = "down";
                CheckState cState = new CheckState(this);
            }
        }
Beispiel #6
0
        public override void nextState(ArchiTetris e)
        {
            BoardState   newState;
            FallingState fState = new FallingState(e);

            newState = (BoardState)fState;
            if (doneFalling)
            {
                DoneState dState = new DoneState(e);
                newState = (BoardState)dState;
            }
            e.lastMove = "";
        }