Hi everyone!
There is something that has me quite confused for the last days. Where do I implement the character behavior (specifically, my 3rd-person character movement) that follows key/mouse input?
Various tutorials on this site and in the book (Kusterer) suggest using booleans in the onAction() method and poll for those in update(), where the actual walking, jumping etc. happens. The problem I have with that is that all these tutorials only seem to cover onAction(), whereas there are almost no examples that cover onAnalog(). Now, when I look into TestChaseCam.java, the movement of the teapot is handled by an analog listener that implements the moving right there in onAnalog().
Are there any best practises for this? Are these different ways of handling input equally valid? At a first glance, I’d say that implementing the actions directly in onAction() & onAnalog() is preferable, because using booleans as “intermediary” between these methods and the update loop seems like an unnecessary step.
Can anyone clarify this (if possible)?
Thanks!