public void fall() { Blick thisBlock = getBlick(); if (!thisBlock.isSettled()) { if (isControlledByPlayer()) { if (Time.time - GameController.lastFall > GameController.fallDelay) { if (checkDown()) { moveBlock(new Vector2(blickPos.x, (blickPos.y - 1))); GameController.lastFall = Time.time; } } } else { if (checkDown()) { moveBlock(new Vector2(blickPos.x, (blickPos.y - 1))); } } } }
public void update() { Blick thisBlock = getBlick(); if (!GameController.accessGameController().blockInPlay&& isControlledByPlayer()) { removePlayerControl(); } if (blickPos.y != 0) { if (checkDown()) { thisBlock.setSettled(false); fall(); } else { thisBlock.setSettled(true); updateBlick(); } } else { thisBlock.setSettled(true); } if (isControlledByPlayer() && thisBlock.isSettled()) { removePlayerControl(); } }
public bool isControlledByPlayer() { if (controlledByPlayer) { if (!checkDown()) { Vector2 getBelow = new Vector2(0.0f, -1.0f); getBelow += blickPos; Blick other = Blick.getBlick(getBelow); if (other != null) { if (other.isSettled()) { removePlayerControl(); } } } } return(controlledByPlayer); }