Day 2, in progress...

I finished gutting the game, but now it doesnt look like the fault was with my stuff :(

My biggest problem is that even though I'm getting 300+ fps, the key responses are choppy, after you press you have to wait a little while before the player moves.
The program still possesses this behavior, even though every thing is "simplified"

I have uploaded an example to our diary, use the arrows to move, the space bar to "jump", note, you dont fall back down ;)


Any one care to look, it requires glut, and I havent inited it, sorry :(, so you may get a weird error that can only be fixed by downgrading your glut.

(log in to comment)

Comments

Ok, can someone please tell me why this is happening?

my fps is > 300, but my game doesnt react to events right, it waits a while...
The really weird thing though, is that if I simply print something, once every frame, the events go great!

I originally thought this was an opengl thing, but it does not now appear to be so.

Anyone know why pygame would act this way, and more importantly why the 'print' command fixes it???
well, it looks like print only helps if you run the game through IDLE :(

I'm about ready to give up, and just go 2d...
Try a clock to limit the framerate to something smaller, like less than 100
Try calling pygame.event.pump() before "for event in" - see this note on pygame documentation:

"There are important things that must be dealt with internally in the event queue. The main window may need to be repainted or respond to the system. If you fail to make a call to the event queue for too long, the system may decide your program has locked up."

It could be that with such a high framerate, the events "lose focus" so to speak.

A third thing to try would be to use the pygame.Key functions instead of events, just to see what keys are pressed at a given time.

I am not at a pythonable computer at the moment, so I can't test these for you. Don't give up on what you have been doing, after coming so far :( Unless there are other issues with the 3d of course.
Well, I'll try your fixes, they do make sense :)

I havent encountered this kind of thing before, but then again I havent had this kind of fps before either.
If I cant get it this to work in, say, an hour, we're going to cut our losses and go with another idea that is far simpler :)
WOW! That worked the first time, and took about 15 seconds, thanks a ton!