public override void nextState(ArchiTetris e) { e.currentBlock = e.rwl.getBlock(); e.currentBlock.setBlocksPos(4, 1); FallingState newState = new FallingState(e); e.bState = newState; }
public override void nextState(ArchiTetris e) { BoardState newState; FallingState fState = new FallingState(e); newState = (BoardState)fState; e.bState = newState; e.lastMove = ""; }
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); } }
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); } }
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); } }
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 = ""; }