Joy Axis hit?

BlitzMax Forums/BlitzMax Programming/Joy Axis hit?

Robb(Posted 2006) [#1]
I'm currently setting up my game to support both keyboard and joypad control and so far it’s working flawlessly, save for one thing...

If for example I need to call Keyhit(KEY_UP), I can't see any obvious equivalent command for the joypad, only JoyY()=-1 which is effectively the same as KeyDown(KEY_UP).

Does anyone have any idea of an easy way to make a JoyAxisHit() command that will only register the joystick movement once?

Thanks!


tonyg(Posted 2006) [#2]
Isn't it Joyhit (pub.freejoy 1.08)?


Robb(Posted 2006) [#3]
As far as I am aware, Joyhit just works for jostick buttons, not the axis :(


Yan(Posted 2006) [#4]



Robb(Posted 2006) [#5]
Awesome! Thanks very much, that's got it sorted :)


Robb(Posted 2006) [#6]
Actually, this doesn't work correctly...



the if Statements only work for the positive values (whichever comes first in the code)....curious. Any ideas on how I can fix that?


Mark1nc(Posted 2006) [#7]
Maybe just call joyxhit() once, store the returned value and use that in the if statement.

xret = joyxhit()
if xret = 1...
if xret = -1...