Skip to main content
8 events
when toggle format what by license comment
Feb 19, 2013 at 2:34 history edited pabdulin CC BY-SA 3.0
edited body
Feb 18, 2013 at 15:29 comment added pabdulin @TrevorPowell that is correct, thanks, I fixed the bug in code example.
Feb 18, 2013 at 15:27 history edited pabdulin CC BY-SA 3.0
added 20 characters in body
Feb 18, 2013 at 14:10 comment added Vabs Thanks for the help guys. @PetrAbdulin you code did give me insight on my problem.
Feb 18, 2013 at 11:15 comment added Trevor Powell Don't put the "if(left_down)" and "if(right_down)" in that function; it needs to go somewhere else, somewhere which gets called precisely once per frame. That event handler function will be called once for each event that comes in during the frame, which could be none, or could be twenty or more. Your movement speed will vary wildly with the code arranged that way. :)
Feb 18, 2013 at 8:51 comment added pabdulin @Kylotan thanks for additional info, I just never worked with SDL :)
Feb 18, 2013 at 8:11 comment added Kylotan Good answer, but you shouldn't need your own keys array, as SDL provides this for you (as I mentioned in my answer).
Feb 18, 2013 at 7:16 history answered pabdulin CC BY-SA 3.0