| Trouble Reading Keyboard Input! |
|
Glocke
|
Hi, try using http://sdl.beuc.net/sdl.wiki/SDL_EnableKeyRepeat before your map loop to enable key repeat. If it's too fast change the delay- and interval-parameters.
Kind regards Glocke |
|||||||||||
|
|
||||||||||||
|
bottler0cket
|
Thanks for the response!
I tried using SDL_EnableKeyRepeat before the map loop, but it doesn't seem to do anything. Essentially I placed SDL_EnableKeyRepeat(10,10); right before the loop, but it makes no indication of repeating the key. Am I calling the function in the wrong place or something? |
|||||||||||
|
|
||||||||||||
|
Glocke
|
Can you post some code? A runnable example of your approach might help to find the problem
|
|||||||||||
|
|
||||||||||||
|
bottler0cket
|
Here's the essential code to compile. You'll need a bitmap called ''character.bmp'' in the project to compile.
Here's one: http://bottler0cket.webs.com/character.bmp Thanks for taking a look :)
|
|||||||||||||
|
|
||||||||||||||
|
Glocke
|
Hi,
here is your fixed code (comments below):
Here are some comments on the code and your problem (they are also in the code at the line with "// @note: [...]":
I don't know what your problem was exactly but not it seems to work. The problem might came from the
part. Actual you do not need the last player position in this case. Well... the list (see above) looks quite long and strict.. but it's cool. These are mostly some performance- or style-tips. I hope the code is already easy-to read for you Kind regards Glocke |
|||||||||||||||
|
|
||||||||||||||||
|
bottler0cket
|
Thank you so much
Thanks a lot for all the advice too. I'm still in the process of learning a lot, so this really speeds things up and avoids some major problems later on! |
|||||||||||
|
|
||||||||||||

