added options "game.forced_scroll_x" and "game.forced_scroll_y"
authorHolger Schemel <info@artsoft.org>
Sat, 14 Oct 2023 18:33:14 +0000 (20:33 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 14 Oct 2023 18:33:14 +0000 (20:33 +0200)
commit8027b4b2df722b639304c8d3d1272b9da527c02e
tree4089bb2125cb8b23cd42b0ba9a4ab262f2dd8530
parentb4962aefbc6cf3356112afe7cf421e073360de14
added options "game.forced_scroll_x" and "game.forced_scroll_y"

This adds the above two "graphicsinfo.conf" options to override the
automatically calculated playfield scroll values when starting a game.

The purpose of these options is to force an initial scroll position
(which is used for all levels), which means that the visible part of
the playfield when the game is started is not determined by the player
position, but by the values defined using the above options.

This may be useful in combination with a large value for the option
"game.forced_scroll_delay_value" to limit the visible part of the
playfield to a smaller, screen-sized area, while the remaining part of
the playfield contains some control elements. It may also be useful
for levels using teleportation from one area to another area while
still controlling which parts of the playfield entered by the player
are visible. It can also be used to force a certain initial visible
part of the playfield, regardless of the exact position of the player
within that area. And it is currently the only way to force showing
levels with an even width or even height with the player near the
border of the playfield with half-tile border elements, which would
also be needed for teleporting the player to a different part of the
playfield without scrolling the playfield relative to the player's
screen position.

Therefore, this feature should probably be considered experimental.
src/conf_gfx.c
src/game.c
src/game.h