initialBoard[i] = GTBoxSpot;
else if (c == '+')
initialBoard[i] = GTBox | GTBoxSpot;
- else if (c == 'o')
+ else if (c == 'o' || c == '*')
{
- initialBoard[i] = GTSpace;
+ initialBoard[i] = (c == '*' ? GTBoxSpot : GTSpace);
initialX = i % width, initialY = i / width;
}
else
// Player is moving into an unoccupied space...
if (cell1 == GTSpace)
{
-// var += direction;
playerX += dx, playerY += dy;
undo[numMoves].dx = dx, undo[numMoves].dy = dy, undo[numMoves].type = PMWalk;
numMoves++;
// Player is pushing a box into an unoccupied space...
else if ((cell1 == GTBox) && (cell2 == GTSpace))
{
-// var += direction;
playerX += dx, playerY += dy;
board[playerX + (playerY * width)] &= GTBoxSpot;
-// var += direction;
playerX += dx, playerY += dy;
board[playerX + (playerY * width)] |= GTBox;
-// var -= direction;
playerX -= dx, playerY -= dy;
undo[numMoves].dx = dx, undo[numMoves].dy = dy, undo[numMoves].type = PMPush;
numMoves++;