Me (eswartz75)!
If you came across this repo, 👋.
Feel free to snoop around and steal ideas, even the bad ones.
But
This is an opinionated set of plugins that can be used in Bevy game projects (it's not on crates.io). I've been using this in my own (private) projects since Bevy 0.15. It currently works for 0.19.
It is not documented but just start from the example example_menu.rs.
But it contains:
-
Mouse cursor grab/ungrab tracking
-
Bevy
Statesfor program, gameplay, level progression -
Bevy
Statesfor overlay (2D) handling ** I.e. when a given menu is up, or whether debug UI is up ** Allows for cleanly hooking up setup/teardown/level switch -
Menuing framework (using
bevy_ui) ** toggles ** sliders ** enums ** main menu vs. escape menu -
Play/pause support (
PauseState, distinct gameplay and menu flags; pausing only affectsTime<Physics>) -
bevy_inspector_eguiintegration -
see
DebugUiStatefor various things visible when debugging enabled (toggle "`") -
bevy_asset_loaderintegration with the states ** I.e.New/Initializing->AssetsLoadedtransitions ** I.e. so you know when you have fonts/icons/etc. available to use ** Any loading errors triggerOverlayState::ErrorScreenso users aren't left wondering when loading will end. -
player camera and FPS or space/flying controller ** keyboard/mouse/controller integration
-
common action setup using bevy_enhanced_input
-
skybox and reflection probe setup from .exr files which occurs when asset collections are ready and performs conversions into cubemaps
-
support for splitting huge meshes into smaller maps to make Avian happy, see
split_into_cubes.rs -
bevy_seedling integration
-
random sound selector for footsteps and sliding when collisions occur on entities with
SurfaceMaterial, seesound_sampler.rs
-
Obligation 😼: I used a version
v0.1of this code for my Bevy Game Jam 7 project here, and according to the rules, prewritten code for that project should be publically available. -
Benevolent indifference 🤷: I thought the code was good enough to be public, or even be snarfed into training data, and might be useful. Take it or leave it. Nothing here is revolutionary. Some things are bad. Some things are my reluctance to refactor.
-
Pragmatism: Being public, I can link to it, share it amongst my projects without needing to have ssh credentials in random OSes and VMs.
I will continue to update this code and use that game jam entry for testing when I remember to. But I don't recommend linking to this crate without the caveat, beware of sudden changes.
fps.rs: based onbevy_mini_fps(single-file implementation inlib.rs)