]> Shamusworld >> Repos - warehouse-man-deluxe/blobdiff - src/gameboard.cpp
Added MOAR boards.
[warehouse-man-deluxe] / src / gameboard.cpp
index 92a0bab05dc5dd8bd59643a298601d1ef677415d..e39d2e56b22e2f202326c6e73915d9bc7eb2d5e7 100644 (file)
@@ -47,9 +47,9 @@ GameBoard::GameBoard(int boardNumber)
                        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
@@ -150,7 +150,6 @@ int GameBoard::Move(int dx, int dy, char cell1, char cell2)
        // 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++;
@@ -159,13 +158,10 @@ int GameBoard::Move(int dx, int dy, char cell1, char cell2)
        // 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++;