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

Re: [pygame] Newbie needs help, what's the most efficient (or easiest) way to do this?



Charles Christie wrote:
Thanks luke, that did it!

My code now looks like this:
**********************
[snip]
           elif event.type == KEYDOWN:
               if event.key == K_ESCAPE:
                   return
               elif event.key == K_TAB:
                   moving = 1
               elif moving == 0:
                   textsprite.keyin(event.unicode)
Hey, that's a good solution!
I didn't even think of trying to do it that way.

*********************

I made the game start recording how many keystrokes and words you get
right in a row. Next I just have to tell the game to render and blit
that value onto the screen (that goes in def update(self), am I
right?) and the combo system will be done.
Well, it depends how your code is logically separated.
Are combos an attribute of the textsprite class?
if that is the case, then update is probably a good place to put it.

Next I'd implement three timer systems, one for each combo counter and one that dictates how long you have to complete the whole list of words. If the timer runs out, the game prints "you loose" and starts over.
Might want to have it say 'you lose' instead ;)

How does that sound?
Sounds good.  What's this business about combos?

Oh, and by the way, I'm in the process of writing a raycaster game engine.
Thought that might interest you since you were thinking of making a first-person shooter typing game, right?
I would be happy to help you modify it to suit your needs.
I will probably GPL it, though, so I think that would mean you'd have to release your source or something.
I dunno exactly what GPL does. Anyway, I could give you a special license to use it probably, if GPL created issues for you.
Let me know if you're interested.
Oh, and is there any way you could add DVORAK support, or at least let me have the code and modify it myself?
I'm trying to learn the DVORAK layout and most typing games I've found with support for that layout aren't very fun.


-Luke