
back command fixed (I think)
By:
ace on
Jul 28th, 2010 | syntax:
None | size: 0.63 KB | hits: 14 | expires: Never
private void back()
{
String reverseLastDirection = "";
if(lastDirection=="north")
{
reverseLastDirection = "south";
if(lastDirection == "east")
{
reverseLastDirection = "west";
}
if(lastDirection == "south")
{
reverseLastDirection = "north";
}
if (lastDirection == "west")
{
reverseLastDirection = "east";
}
Command backCommand = new Command("go", reverseLastDirection);
goRoom(backCommand);
}