Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualKhatharr

Posted 29 December 2012 - 11:06 AM

First, don't set all your bools to false at the start of handleKeys(). That defeats the purpose of checking to see if they were released. I'm really surprised you're not getting the opposite problem. The way the code is written there I'd expect your guy to only move on the frame when the key was initially pressed.

 

Can you confirm that SDL_KEYUP messages are being generated when a key is released?


#2Khatharr

Posted 29 December 2012 - 10:50 AM

First, don't set all your bools to false at the start of handleKeys(). That defeats the purpose of checking to see if they were released. I'm really surprised you're not getting the opposite problem. The way the code is written there I'd expect your guy to only move on the frame when the key was initially pressed.


#1Khatharr

Posted 29 December 2012 - 10:47 AM

First, don't set all your bools to false at the start of handleKeys(). That defeats the purpose of checking to see if they were released. (So I'm surprised you're not getting a different problem.)

 

Is handleKeys() embedded in your message handling loop? How/where is this function called?


PARTNERS