Re: [pygame] raw_input() and pygame.event.get()

2006-12-11 Thread Mike Wyatt

Mike Wyatt wrote:

Pete Shinners wrote:

On Sun, 2006-12-10 at 22:12 -0600, Mike Wyatt wrote:
 

Oops, I forgot to mention that.  I'm using raw_input() because I want
to focus on getting my game working before putting time into writing a
GUI.  Without a GUI, the only way I can get user input is with
raw_input().  I'm working on my networking code, so I need to have
each game instance ask the user (i.e. myself) to host a new game or
join an existing game.



Use the pygame event filtering to block certain event types. Turn this
off and on around your input_raw call.

http://pygame.org/docs/ref/event.html#pygame.event.set_blocked

pygame.event.set_blocked(pygame.KEYDOWN | pygame.KEYUP)
value = raw_input()
pygame.event.set_blocked(None)



  
That code doesn't block the events.  They still appear in the next 
call to pygame.event.get().  Here is a script you can run to verify this:


*
import pygame

pygame.init()
displaySurface = pygame.display.set_mode( (400, 300), 0 )

while True:

   for event in pygame.event.get():
   print event
   if event.type == pygame.KEYDOWN and event.key == pygame.K_s:
   pygame.event.set_blocked(pygame.KEYDOWN | pygame.KEYUP)
   value = raw_input("Type some stuff (include the 's' 
character): ")

   pygame.event.set_blocked(None)
   print "You typed", value
   pygame.display.flip()
*


pygame.display.flip() didn't have the appropriate indentation.  It 
should be corrected now (above).  Has anyone run this and confirmed my 
problem?


Re: [pygame] Galcon released

2006-12-11 Thread Farai Aschwanden

Hello Phil

Was testing now the released OSX version. Works great now, so tnx for  
supporting the Mac. ;)
The game is highly addictive but that is knocked out by the high  
difficulty. :/
Maybe Im doing something wrong or its just that difficult (erm, Im  
playing it in *cough* easy mode *cough*). I like the fast thinking  
stress factor.

Well I further test it out as long as the demo is running.

Great job Phil!

Farai



Am 10.12.2006 um 16:59 schrieb Phil Hassey:


Farai,

I hope to have a OSX PPC version up pretty soon.  Check back in  
maybe a week.


(The Ludum Dare edition is possible to get working with the .tgz ..  
If you have the right setup.  No promises though.  Read the  
README.txt on how to compile it.)


Phil

Farai Aschwanden <[EMAIL PROTECTED]> wrote:
Hello

I tried to downlad it for Mac (OSX, PPC). Well I couldnt find a  
special version for Mac, so I downloaded the 473_philhassey.zip.

After extracting I started 'demo.py' with the following errors:

ImportError: No module named_flock
File "demo.py", line 10, in '?'
   import flock
File "flock.py", line 5, in '?'
  import flock

Same errors on main.py

Thats where it always stops. Did I start the wrong Python module?

So I downloaded '373_ld488.tgz' and tried to start the same modules  
again with the same erros.


The game looks so far great and interesting. Im just too stupid to  
start it. o.O


Greetings
Farai



Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.