added support for "player is moving up/down" graphics for BD engine
authorHolger Schemel <info@artsoft.org>
Sun, 14 Apr 2024 21:33:09 +0000 (23:33 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 14 Apr 2024 21:33:24 +0000 (23:33 +0200)
src/game_bd/bd_cave.c
src/game_bd/bd_cavedb.c
src/game_bd/bd_elements.h
src/tools.c

index 7e808a25727c8239a50a6c5ab0097e283ffc0c9b..cedab63d1da8d917bb766dc8d81b35550ef981f6 100644 (file)
@@ -1455,6 +1455,16 @@ void gd_drawcave_game(const GdCave *cave,
       draw = gd_elements[O_PLAYER].image_game;
     }
   }
+  else if (cave->last_direction == GD_MV_UP)
+  {
+    map = O_PLAYER_UP;
+    draw = gd_elements[O_PLAYER_UP].image_game;
+  }
+  else if (cave->last_direction == GD_MV_DOWN)
+  {
+    map = O_PLAYER_DOWN;
+    draw = gd_elements[O_PLAYER_DOWN].image_game;
+  }
   else if (cave->last_horizontal_direction == GD_MV_LEFT)
   {
     map = O_PLAYER_LEFT;
index ff9df20552936eba610ef7360dfa204882612f59..943b536f87f21068299352b19b3cf4baadc063cb 100644 (file)
@@ -374,6 +374,8 @@ GdElements gd_elements[] =
   { O_COVERED, NULL, 0, NULL, 0, 128, -128, -128 },
   { O_PLAYER_LEFT, NULL, P_PLAYER, NULL, 0, 232, -232, -232 },
   { O_PLAYER_RIGHT, NULL, P_PLAYER, NULL, 0, 240, -240, -240 },
+  { O_PLAYER_UP, NULL, P_PLAYER, NULL, 0, 376, -376, -376 },
+  { O_PLAYER_DOWN, NULL, P_PLAYER, NULL, 0, 384, -384, -384 },
   { O_PLAYER_TAP, NULL, P_PLAYER, NULL, 0, 216, -216, -216 },
   { O_PLAYER_BLINK, NULL, P_PLAYER, NULL, 0, 208, -208, -208 },
   { O_PLAYER_TAP_BLINK, NULL, P_PLAYER, NULL, 0, 224, -224, -224 },
index 34945ec73b6e295a0c15646209bb785b40f6ca9f..dd36b1ee0ff391b8661cac9c84cf8d333022567b 100644 (file)
@@ -279,6 +279,8 @@ typedef enum _element
   O_COVERED,
   O_PLAYER_LEFT,
   O_PLAYER_RIGHT,
+  O_PLAYER_UP,
+  O_PLAYER_DOWN,
   O_PLAYER_TAP,
   O_PLAYER_BLINK,
   O_PLAYER_TAP_BLINK,
index 7734259098d5cb2023b42e14fb5cbcb0919a81c1..39976f9d9522949cc221b0234f69950c968b4e08 100644 (file)
@@ -7481,6 +7481,14 @@ bd_object_mapping_list[] =
     O_PLAYER_RIGHT,                            FALSE,
     EL_BD_PLAYER,                              ACTION_MOVING, MV_BIT_RIGHT
   },
+  {
+    O_PLAYER_UP,                               FALSE,
+    EL_BD_PLAYER,                              ACTION_MOVING, MV_BIT_UP
+  },
+  {
+    O_PLAYER_DOWN,                             FALSE,
+    EL_BD_PLAYER,                              ACTION_MOVING, MV_BIT_DOWN
+  },
   {
     O_PLAYER_BLINK,                            FALSE,
     EL_BD_PLAYER,                              ACTION_BORING_1, -1