Joystic Problem

I’m having a problem with the sdl joystick, maybe you could help me out :slight_smile:

What I’m trying to do is use the SDL_JOYAXISMOTION for movement in a game
but I can only get the object to move by hitting the axis over and over,
Instead of a press and hold ->move
Is there a function for for this like the SDL_EnableKeyRepeat ?
Is there somthing i’m missing?

What you need to do is have a variable that represents the state of the
joystick. Constantly move based on this value, and upon receiving a
joyaxismotion event, update that value appropriately.

Another thing you might want to add is acceleration and deceleration,
but that depends on the game. It certainly can make a game’s play
control feel more polished.On Aug 6, 2004, at 5:58 AM, charlie carley wrote:

I’m having a problem with the sdl joystick, maybe you could help me
out :slight_smile:

What I’m trying to do is use the SDL_JOYAXISMOTION for movement in a
game
but I can only get the object to move by hitting the axis over and
over,
Instead of a press and hold ->move
Is there a function for for this like the SDL_EnableKeyRepeat ?
Is there somthing i’m missing?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

  • Donny Viszneki