Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Moving a player while holding down a key.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
21 replies to this topic

#21 BeerNutts   Members   

4390
Like
0Likes
Like

Posted 03 January 2013 - 03:49 PM

I tried that method. It was the first thing I tried
If I hold down the key the payer doesn't move. I have to repeatedly tap the key.

 

Yeah, but you have to call handleKeys() on EVERY LOOP, not just when an SDL Key Event is triggered.

 

If you are checking the key state every single loop, then you will always see the key is down, and it WILL always move.


My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#22 GDsnakes   Members   

151
Like
0Likes
Like

Posted 03 January 2013 - 05:41 PM

I tried that method. It was the first thing I tried
If I hold down the key the payer doesn't move. I have to repeatedly tap the key.

 

 

Yeah, but you have to call handleKeys() on EVERY LOOP, not just when an SDL Key Event is triggered.

 

If you are checking the key state every single loop, then you will always see the key is down, and it WILL always move.

ahhh thank you very much. I just figured it out lol. You were right.

 

 

 

I love the Gamedev community! you guys are a big help.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.