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

Re: [pygame] Re:



> ----- Original Message -----
> From: pymike <pymike93@xxxxxxxxx>
> To: pygame-users@xxxxxxxx
> Subject: [pygame] Re:
> Date: Sun, 28 Sep 2008 16:24:11 -0500
> 
> 
> Depends on your game structure, but if you're using pygame it'd be easiest
> to just go
> 
> import pygame
> from pygame.locals import *
> 
> paused = False
> game_is_running = True
> while game_is_running:
> 
>          #Set pause varaiable to True if the P key is pressed
>      for e in pygame.event.get():
>          if e.type == KEYDOWN and e.key == K_p:
>              paused = True
> 
>          #Wait until the pause key is pressed again
>      while paused:
>          for e in pygame.event.get():
>              if e.type == KEYDOWN and e.key == K_p:
>                  paused = False
> 
> HTH
> 
> On Sun, Sep 28, 2008 at 11:46 AM, yanom @linuxmail.org
> <yanom@xxxxxxxxxxxxx>wrote:
> 
> > This probably seems like a dumb and obvious question, but I'm new to
> > pygame, so...
> >
> > How do I build a pause function into the game?
> >
> > =
> > Mail Commander
> > This e-mail client provides extensive anti-spam filtering and mail
> > processing capabilities.
> >
> > http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=1fd077cd01934c63240778606a312794
> >
> >
> > --
> > Powered by Outblaze
> >
> 
> 
> 
> --
> - pymike (http://pymike.4rensics.org/)

>
thanks

=
Steamboat Springs Luxury Real Estate
Steamboat Springs Ski Resort views from this $2.3 million secluded property on 7.9 acres. Free guide to Steamboat Springs fine homes, ranches, golf course and lake front property.
http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=64d9cd41575dd519943fcbc5f3a13b4c


-- 
Powered by Outblaze