[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Problems with events and keys



Alright, so I have attached my code to this message. Things are going good... the only thing I have to do is finish repositioning text. Or at least that's what I thought... When I started typing, after I pressed shift, the combo counter kept resetting to 0 for some reason. I tried to edit my if-else statements (the def keyin section of Textsprite) to fix that but it didn't work. So if I, in the event section at the bottom, made shift not be registered to textsprite, would the fact that it accepts event.unicode make it accept the capital letter and not the press of the shift key?

The next thing is events. I haven't checked if the program acts properly if the event GAME_OVER_W is sent after you type everything because I never bothered to finish typing my cue - I am too busy now trying to figure out why SUBTRACT_TIMER (which I should probably rename COUNTDOWN later) won't work with the timer I set. I never had luck with global variables before anyway.

I'm getting very far with this and it wouldn't have been possible without your help - Thank you all very much. When I learn to program the credits, you can guarantee that pygame mailing list will be in there somewhere near the top. ;-)

Attachment: helpers.py
Description: Binary data

Attachment: typinggame.py
Description: Binary data