tape.property_bits |= TAPE_PROPERTY_TAS_KEYS;
}
}
+
+ // also handle suicide key for the first player only
+ if (key == setup.shortcut.suicide)
+ key_action |= KEY_SUICIDE;
}
if (key_status == KEY_PRESSED)
si->shortcut.speed_fast = DEFAULT_KEY_SPEED_FAST;
si->shortcut.speed_slow = DEFAULT_KEY_SPEED_SLOW;
+ si->shortcut.suicide = DEFAULT_KEY_SUICIDE;
+
for (i = 0; i < MAX_PLAYERS; i++)
{
si->input[i].use_joystick = FALSE;
game->player_move = GD_MV_STILL;
game->player_move_stick = FALSE;
game->player_fire = FALSE;
+ game->player_suicide = FALSE;
+ game->player_suicide_stick = FALSE;
game->state_counter = GAME_INT_LOAD_CAVE;
return (game->milliseconds_game + millisecs_elapsed >= game->cave->speed);
}
-static void iterate_cave(GdGame *game, GdDirection player_move, boolean fire)
+static void iterate_cave(GdGame *game, GdDirection player_move, boolean fire, boolean suicide)
{
- boolean suicide = FALSE;
-
// ANYTHING EXCEPT A TIMEOUT, WE ITERATE THE CAVE
if (game->cave->player_state != GD_PL_TIMEOUT)
{
player_move = ((action_bd & GD_REPLAY_MOVE_MASK));
fire = ((action_bd & GD_REPLAY_FIRE_MASK) != 0);
+ suicide = ((action_bd & GD_REPLAY_SUICIDE_MASK) != 0);
}
}
// reset cycle frame counter for the next cave iteration
game->itercycle = 0;
- iterate_cave(game, game->player_move, game->player_fire);
+ iterate_cave(game, game->player_move, game->player_fire, game->player_suicide);
game->cycle_counter++;
game->player_move = GD_MV_STILL;
}
+ if (game->player_suicide == FALSE)
+ {
+ game->player_suicide_stick = FALSE;
+ }
+ else
+ {
+ game->player_suicide_stick = TRUE;
+ game->player_suicide = FALSE;
+ }
+
// as we iterated, the score and the like could have been changed.
return_state = GD_GAME_LABELS_CHANGED;
boolean move_left = ((action & JOY_LEFT) != 0);
boolean move_right = ((action & JOY_RIGHT) != 0);
boolean fire = ((action & JOY_BUTTON) != 0);
+ boolean suicide = ((action & KEY_SUICIDE) != 0);
if (game->player_move_stick || move_up || move_down || move_left || move_right) // no "fire"!
{
if (game->player_move == GD_MV_STILL)
game->player_fire = fire;
+ if (game->player_suicide_stick || suicide)
+ game->player_suicide = suicide;
+
// tell the interrupt "20ms has passed"
state = gd_game_main_int(game, !game->out_of_window, FALSE);
GdDirection player_move;
boolean player_move_stick;
boolean player_fire;
+ boolean player_suicide;
+ boolean player_suicide_stick;
GdCave *cave; // Copy of the cave. This is the iterated, changed (ruined...) one
GdCave *original_cave; // original cave from caveset. used to record highscore
action & JOY_LEFT,
action & JOY_RIGHT);
int player_fire = ((action & JOY_BUTTON) != 0 ? GD_REPLAY_FIRE_MASK : 0);
+ int player_suicide = ((action & KEY_SUICIDE) != 0 ? GD_REPLAY_SUICIDE_MASK : 0);
- return (player_move | player_fire);
+ return (player_move | player_fire | player_suicide);
}
int map_action_BD_to_RND(int action)
{
GdDirection player_move = ((action & GD_REPLAY_MOVE_MASK));
boolean player_fire = ((action & GD_REPLAY_FIRE_MASK) != 0);
+ boolean player_suicide = ((action & GD_REPLAY_SUICIDE_MASK) != 0);
int action_move = (player_move == GD_MV_UP ? JOY_UP :
player_move == GD_MV_UP_RIGHT ? JOY_UP | JOY_RIGHT :
player_move == GD_MV_LEFT ? JOY_LEFT :
player_move == GD_MV_UP_LEFT ? JOY_UP | JOY_LEFT : JOY_NO_ACTION);
int action_fire = (player_fire ? JOY_BUTTON_1 : JOY_NO_ACTION);
+ int action_suicide = (player_suicide ? KEY_SUICIDE : JOY_NO_ACTION);
- return (action_move | action_fire);
+ return (action_move | action_fire | action_suicide);
}
boolean checkGameRunning_BD(void)
#define DEFAULT_KEY_SNAP_DOWN KSYM_UNDEFINED
#define DEFAULT_KEY_SPEED_FAST KSYM_f
#define DEFAULT_KEY_SPEED_SLOW KSYM_s
+#define DEFAULT_KEY_SUICIDE KSYM_F12
// default debug setup keys and values
#define DEFAULT_FRAME_DELAY_0 20 // 100 % speed
#define NUM_PLAYER_ACTIONS 6
-// values for special "focus player" bitmasks
+// values for special "focus player" and "suicide" bitmasks
#define BIT_SET_FOCUS 6
+#define BIT_SUICIDE 7
// values for drawing stages for global animations
#define DRAW_GLOBAL_ANIM_STAGE_1 1
#define KEY_ACTION (KEY_MOTION | KEY_BUTTON)
#define KEY_SET_FOCUS (1 << BIT_SET_FOCUS)
+#define KEY_SUICIDE (1 << BIT_SUICIDE)
#define MV_DIR_FROM_BIT(x) ((x) < NUM_DIRECTIONS ? 1 << (x) : \
(x) == MV_BIT_UPLEFT ? MV_UPLEFT : \
Key speed_fast;
Key speed_slow;
+
+ Key suicide;
};
struct SetupSystemInfo