java coding help please?

im coding tetris for a project and i have a question on coding my rotate method. my code so far only has TetrisBlock rotating if rotationPos == 0

public void rotate()
{
Location nextLoc;
if (rotationPos == 0)
{
nextLoc = new Location(getLocation().getRow() - 1, getLocation().getCol() + 1);
if (gr.isValid(nextLoc) && gr.get(nextLoc) == null)
{
moveTo(nextLoc);
rotationPos = (rotationPos + 1) % 2;
}
else if (rotationPos == 1)
{
}
}
}

how do i write my else if statement so that TetrisBlock will rotate back if rotationPos == 1??
please help!
 
Back
Top