Difference between KeyBindingManager and KeyInputHandlers

I’m having a hard time figuring out the difference between the KeyBindingManager and the KeyInputHandler stuff.



In general the KeyInputHandlers seem to handle more complicated actions but is there any reason to not make everything a KeyInputHandler?



Also, I’ve been having a hard time getting away from using SimpleGame and was wondering if anyone had some advice for how I should set things up.



Right now it just seems like SimpleGame has too much unrelated stuff going on in it.



How have other people split up their classes etc? Thank you very much for any advice.

A simple (excuse the pun) way to get away from SimpleGame is to simply (again) copy SimpleGame to a new file, paste your methods in from your derived class, and then straighten out the class name and package. Afterwards, you can trim out the extras which are mostly just bounding displays, wireframe and various keypresses. Trim out the fpsNode stuff too if you don’t care to have that.



As for the two key handling methods… It’s a matter of choice really. I prefer InputHandler for most of my control related key presses. Those are seperate classes I build though. For simple stuff like toggling something on/off, KeyBindingManager isValidCommand is quick (just a few lines of code) and doesn’t require writing new classes.

THank you for the advice Renase.

BaseGame is what SimpleGame extends. Simple game does do alot of things for you that you should do yourself if your going to do anything more complicated than just drawing stuff on screen.



E.g. If you want to limit the FPS of your game, you would need SimpleGame to extend FixedFramerateGame. If you want to render as fast as possible, but limit your UpdatesPerSecond (very good for physics and AI) is to extend FixedLogicrateGame. If you just want the paramteres in update(float) in Abstractgame to contain the time between frames (interpolation) then extending VariableTimestepGame is the way to go.



Yes, there is life outside of simpleGame :wink:



DP