]> Shamusworld >> Repos - warehouse-man-deluxe/commitdiff
Added MOAR boards.
authorShamus Hammons <jlhamm@acm.org>
Tue, 1 Jul 2014 14:34:31 +0000 (09:34 -0500)
committerShamus Hammons <jlhamm@acm.org>
Tue, 1 Jul 2014 14:34:31 +0000 (09:34 -0500)
src/boards.cpp
src/boards.h
src/gameboard.cpp
src/mainwin.cpp

index 7ade8327eb75ddb4f5f90c9048392fcac6f27a70..8cf5ed7bf385e4dd741220005c6754b77cbc114a 100644 (file)
@@ -21,6 +21,7 @@
 //   . = Spot to move box to
 //   + = Spot to move box to, that already has a box on it
 //   o = Player initial position
+//   * = Player initial position, that has a spot under it
 //   - = Do not draw anything here
 //
 
@@ -271,9 +272,359 @@ static const struct {
 };
 
 
+static const struct {
+       unsigned int width, height;
+       unsigned char state[10 * 7 + 40 + 1]; } board019 = { 10, 7,
+       "-@@@@@@@--"
+       "-@     @@@"
+       "@@X@@@   @"
+       "@ o X  X @"
+       "@ ..@ X @@"
+       "@@..@   @-"
+       "-@@@@@@@@-"
+       "Untitled1"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 6 + 40 + 1]; } board020 = { 8, 6,
+       "---@@@@@"
+       "@@@@  .@"
+       "@   X +@"
+       "@ XX X.@"
+       "@@o@@..@"
+       "-@@@@@@@"
+       "Untitled2"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[7 * 7 + 40 + 1]; } board021 = { 7, 7,
+       "@@@@@@@"
+       "@.   .@"
+       "@ X@X @"
+       "@.XoX.@"
+       "@ X@X @"
+       "@.   .@"
+       "@@@@@@@"
+       "Cornered"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[7 * 7 + 40 + 1]; } board022 = { 7, 7,
+       "@@@@@@@"
+       "@  .  @"
+       "@ X@X @"
+       "@. + .@"
+       "@ X@X @"
+       "@  .o @"
+       "@@@@@@@"
+       "Diamond"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[9 * 7 + 40 + 1]; } board023 = { 9, 7,
+       "@@@@@@@@-"
+       "@    o @-"
+       "@ X..  @@"
+       "@@@..@  @"
+       "--@@XXX @"
+       "---@    @"
+       "---@@@@@@"
+       "Untitled3"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 8 + 40 + 1]; } board024 = { 8, 8,
+       "@@@@@@@@"
+       "@   o  @"
+       "@ XX@  @"
+       "@@  X @@"
+       "-@.X  @-"
+       "-@@. @@-"
+       "--@..@--"
+       "--@@@@--"
+       "Untitled4"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 8 + 40 + 1]; } board025 = { 8, 8,
+       "-@@@@@@-"
+       "-@. ..@-"
+       "-@. X.@-"
+       "@@@  X@@"
+       "@ X  X @"
+       "@ @X@@ @"
+       "@   o  @"
+       "@@@@@@@@"
+       "Untitled5"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[7 * 7 + 40 + 1]; } board026 = { 7, 7,
+       "-@@@@@@"
+       "@@ . o@"
+       "@ X X @"
+       "@. + .@"
+       "@ X X @"
+       "@@ . @@"
+       "-@@@@@-"
+       "Untitled6"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 7 + 40 + 1]; } board027 = { 8, 7,
+       "--@@@@@@"
+       "--@    @"
+       "@@@XXX @"
+       "@o X.. @"
+       "@ X...@@"
+       "@@@@  @-"
+       "---@@@@-"
+       "Untitled7"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[12 * 5 + 40 + 1]; } board028 = { 12, 5,
+       "@@@@@@@@@@@@"
+       "@    ... X @"
+       "@ XXX+++ Xo@"
+       "@    ... X @"
+       "@@@@@@@@@@@@"
+       "Untitled8"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 7 + 40 + 1]; } board029 = { 8, 7,
+       "@@@@@@@@"
+       "@  @   @"
+       "@ X..X @"
+       "@oX.+ @@"
+       "@ X..X @"
+       "@  @   @"
+       "@@@@@@@@"
+       "Untitled9"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[11 * 9 + 40 + 1]; } board030 = { 11, 9,
+       "--@@@@@----"
+       "--@   @----"
+       "@@@X.X@@@@@"
+       "@   . X   @"
+       "@ @@X@@ o @"
+       "@   . @@@@@"
+       "@@@ . @----"
+       "--@   @----"
+       "--@@@@@----"
+       "Untitled10"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[11 * 7 + 40 + 1]; } board031 = { 11, 7,
+       "---@@@@@@@@"
+       "@@@@    . @"
+       "@  X X X. @"
+       "@  .@@@@.@@"
+       "@ X.X X o@-"
+       "@  .  @@@@-"
+       "@@@@@@@----"
+       "Untitled11"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 7 + 40 + 1]; } board032 = { 8, 7,
+       "-@@@@@--"
+       "-@   @@@"
+       "@@X@o .@"
+       "@  XX@.@"
+       "@ @X  .@"
+       "@     .@"
+       "@@@@@@@@"
+       "Untitled12"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[9 * 8 + 40 + 1]; } board033 = { 9, 8,
+       "---@@@@@-"
+       "@@@@.  @@"
+       "@ X.X.  @"
+       "@oX@ @X @"
+       "@ X. .  @"
+       "@@@@X@X @"
+       "--@. .  @"
+       "--@@@@@@@"
+       "Untitled13"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[9 * 8 + 40 + 1]; } board034 = { 9, 8,
+       "---@@@@@-"
+       "---@ o @-"
+       "---@XXX@-"
+       "@@@@   @-"
+       "@   .@X@@"
+       "@ X.X. .@"
+       "@  @.@.@@"
+       "@@@@@@@@-"
+       "Untitled14"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[9 * 8 + 40 + 1]; } board035 = { 9, 8,
+       "@@@@@@---"
+       "@    @---"
+       "@ X  @@@@"
+       "@ X+..+ @"
+       "@ +..+X @"
+       "@@@@  X @"
+       "---@ o  @"
+       "---@@@@@@"
+       "Untitled15"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[7 * 6 + 40 + 1]; } board036 = { 7, 6,
+       "@@@@@@@"
+       "@  +  @"
+       "@ .+. @"
+       "@ XXX @"
+       "@ o.  @"
+       "@@@@@@@"
+       "Untitled16"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 7 + 40 + 1]; } board037 = { 8, 7,
+       "@@@@@@@@"
+       "@..    @"
+       "@..X Xo@"
+       "@X@XXX@@"
+       "@..X X @"
+       "@..    @"
+       "@@@@@@@@"
+       "Untitled17"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[9 * 8 + 40 + 1]; } board038 = { 9, 8,
+       "---@@@@@@"
+       "@@@@.  o@"
+       "@  XXX  @"
+       "@.@@.@@.@"
+       "@   X   @"
+       "@  X.@ @@"
+       "@@@@   @-"
+       "---@@@@@-"
+       "Untitled18"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[12 * 7 + 40 + 1]; } board039 = { 12, 7,
+       "--@@@@@@@@@@"
+       "@@@   .    @"
+       "@   @@X@@  @"
+       "@ oX. . .X@@"
+       "@@ X@@X@@ @ "
+       "-@    .   @ "
+       "-@@@@@@@@@@ "
+       "Untitled19"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[9 * 7 + 40 + 1]; } board040 = { 9, 7,
+       "@@@@@@@@@"
+       "@.  .  .@"
+       "@@XXXXX@@"
+       "@..o+ ..@"
+       "@@XXXXX@@"
+       "@.  .  .@"
+       "@@@@@@@@@"
+       "Untitled20"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[8 * 7 + 40 + 1]; } board041 = { 8, 7,
+       "@@@@@---"
+       "@   @---"
+       "@  X@@@@"
+       "@.+*+  @"
+       "@ XX+  @"
+       "@   .  @"
+       "@@@@@@@@"
+       "Untitled21"
+};
+
+
+static const struct {
+       unsigned int width, height;
+       unsigned char state[9 * 7 + 40 + 1]; } board042 = { 9, 7,
+       "-@@@@@@@-"
+       "@@.X X.@@"
+       "@.+ X +.@"
+       "@  XoX  @"
+       "@.+ X +.@"
+       "@@.X X.@@"
+       "-@@@@@@@-"
+       "Untitled22"
+};
+
+
 const void * boards[] = {
        &board001, &board002, &board003, &board004, &board005, &board006, &board007, &board008,
        &board009, &board010, &board011, &board012, &board013, &board014, &board015, &board016,
-       &board017, &board018, //&board019, &board020, &board021, &board022, &board023, &board024,
+       &board017, &board018, &board019, &board020, &board021, &board022, &board023, &board024,
+       &board025, &board026, &board027, &board028, &board029, &board030, &board031, &board032,
+       &board033, &board034, &board035, &board036, &board037, &board038, &board039, &board040,
+       &board041, &board042, //&board043, &board044, &board045, &board046, &board047, &board048,
+//     &board049, &board050, &board051, &board052, &board053, &board054, &board055, &board056,
+//     &board057, &board058, &board059, &board060, &board061, &board062, &board063, &board064,
+//     &board065, &board066, &board067, &board068, &board069, &board070, &board071, &board072,
+//     &board073, &board074, &board075, &board076, &board077, &board078, &board079, &board080,
+//     &board081, &board082, &board083, &board084, &board085, &board086, &board087, &board088,
+//     &board089, &board090, &board091, &board092, &board093, &board094, &board095, &board096,
+//     &board097, &board098, &board099, &board100, &board101, &board102, &board103, &board104,
 };
 
index f2a8a2f7b195bffeff1b47049cd7b6e145b396bf..e14b564e950d92b478f048747615e55128a1d94d 100644 (file)
@@ -12,7 +12,7 @@ struct Board {
        unsigned char state[];  // Board data
 };
 
-#define NUMBER_OF_BOARDS       18
+#define NUMBER_OF_BOARDS       42
 extern const void * boards[];
 
 #endif // __BOARDS_H__
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++;
index 9b8fb296d01bc0f4585ba47d5b7e3409fbdc0515..010f27f7d63f78ab6652bfd87743b3f5c4d4d8f4 100644 (file)
@@ -272,7 +272,7 @@ void MainWin::ResetGame(void)
 
 void MainWin::AboutGame(void)
 {
-       QMessageBox::about(this, tr("About Warehouse Man Deluxe"), tr("Warehouse Man Deluxe Version 1.0\n\nCopyright © 2014 Underground Software\n\nWritten by James L. Hammons"));
+       QMessageBox::about(this, tr("About Warehouse Man Deluxe"), tr("Warehouse Man Deluxe Version 1.0\n\nCopyright (C) 2014 Underground Software\n\nWritten by James L. Hammons"));
 }