yes, i hv written the method, 'moveLeft()', 'moveRight()', 'moveUp()', and 'moveDown() and thew orld is 8 x 8.
i want to achieve the same outcome as they stated above., Using the key (left, right, up, down) to move the chess for 1 step each time.
String myKey = Greenfoot.getKey();
if (this.equals(ChessWorld.lastChessClicked) && myKey != null)
{
if ("up".equals(myKey) && getY() > 0) moveUp();
if ("down".equals(myKey) && getY() < 7) moveDown();
if ("left".equals(myKey) && getX() > 0) moveLeft();
if ("right".equals(myKey) && getX() < 7) moveRight();
}
if (Greenfoot.mouseClicked(this))
{
if (isFlipped)
{
ChessWorld.lastChessClicked = this;
}
else
{
flip();
isFlipped = true;
}
}