Posts Tagged marte engine key input

Marte Engine Define() and Check()

I'm not very fond of the way that Marte Engine's Input checking occurs. It simplifies things a bit in one area and complicates things in all other areas. The simplification comes from the fact that one can list all the keys for a given action in the listener definition (define("name", keys...), and that is pretty helpful.

However there's something I don't really care for when it comes to the way Marte Engine handles keyboard input, namely, it's too fast. The key repeat becomes an issue when working with things like menus.

Disclaimer: I'm far from being a Java or game development guru. I'm merely pointing out that I ran into this issue. There could very well be a work-around for this within the Marte engine itself. I ran into this problem while trying to implement a main menu for a test game I was working on. When I would push a button, the menu selection cursor would jump to the bottom of the menu, which isn't at all what I wanted it to do.

The believe the reason for this is that the input definitions one can make with a define() method are set to handle only KeyDown events, while I needed a KeyPressed event. Since I could find no other way to force it to use a keypress instead of a keydown, I decided to remove my input event definitions and use a standard check on the input to see if a certain button has been pressed (down and released). This solved my issue with the key events. Now my menu cursor performs as expected.

, , ,

No Comments