Closed AlisCode closed 4 years ago
Awesome, thank you!
Specific points:
It honestly may be easier to have a macro that takes in a list of event inputs and generates code to turn them into states in a struct rather than using a hashmap, so you could just do input_state.player[0].axis_y
instead of input_state.get_player_axis_raw(Axes::Vert, 0)
. But Magical Codegen Macros are also a little counter to the ggez ethos, so, I dunno.
Meh.
Silly me, I got things mixed up and instead of just trying and eventually noticing that we don't store them as keys, I just packed my PR up and called it a week-end.
I'll have another PR on the way soon-ish bringing:
Fixes #21 .
Refactors the Input module.
Breaking changes
Notes
InputState::new()
and now also implementsDefault
forSPECS
usage, building an InputState from scratch should be discouraged, as it is preferable to use the new InputStateBuilder.Caveats
from_config
method to create it directly from a.ron
file. Adding a dependency is a decision that should not be taken lightly though, andRON
does not seem to be part of the ggez "ecosystem" yet, so that's a no-go for now.