ggez / ggez-goodies

Useful modules for the ggez Rust game framework.
MIT License
63 stars 17 forks source link

Input module ergonomics and features #22

Closed AlisCode closed 4 years ago

AlisCode commented 4 years ago

Fixes #21 .

Refactors the Input module.

Breaking changes

Notes

Caveats

icefoxen commented 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.

AlisCode commented 4 years ago

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: