fishfolk / jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang 🦀 and Bevy 🪶
https://fishfolk.org/games/jumpy/
Other
1.65k stars 121 forks source link

feat: quick debug env vars #1031

Closed nelson137 closed 1 day ago

nelson137 commented 6 days ago

Add support for some environment variables, only available in debug builds, that allow for quickly loading into a single-player game.

Examples

To launch straight into a single-player match with Fishy, the default player, on Keyboard1:

TEST_MAP='Dev Level 1' cargo run

You can also specify another player:

TEST_MAP='Dev Level 1' TEST_PLAYER='Sharky' cargo run

And even provide a hat:

TEST_MAP='Dev Level 1' TEST_PLAYER='Sharky' TEST_HAT='Cowboy Hat' cargo run

Or, auto-select a player, launching directly to the map select menu (again, optionally with a hat):

TEST_PLAYER='Orcy' TEST_HAT='Unicorn Hat' cargo run

All of these examples set Keyboard1 as the control source for the player. You can provide a different source like so:

TEST_CONTROLLER='Gamepad' TEST_MAP='Dev Level 1' cargo run

Any combination of one or more of these four environment variables will skip straight to either the map select menu or directly into a match if a map is provided. Fishy with no hat on keyboard1 is the default if only a map is given.