From 077af9b750d4a670455ae44438d1b1db059eb532 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 10 Mar 2024 17:35:56 +0100 Subject: [PATCH] increased scrolling speed when wrapping around for BD engine --- src/game_bd/bd_graphics.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index bb3fb894..ef87fc0f 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -261,6 +261,13 @@ boolean gd_scroll(GdGame *game, boolean exact_scroll, boolean immediate) player_x = game->cave->player_x - game->cave->x1; // cell coordinates of player player_y = game->cave->player_y - game->cave->y1; + // when wrapping around to opposite level border, use faster scrolling + if (game->cave->player_x == game->cave->x1 || + game->cave->player_x == game->cave->x2 || + game->cave->player_y == game->cave->y1 || + game->cave->player_y == game->cave->y2) + scroll_speed *= 4; + // pixel size of visible part of the cave (may be smaller in intermissions) visible_x = (game->cave->x2 - game->cave->x1 + 1) * cell_size; visible_y = (game->cave->y2 - game->cave->y1 + 1) * cell_size; -- 2.34.1