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

[pygame] Re:



Oh and you'll need to set the display screen up too

On Sun, Sep 28, 2008 at 4:24 PM, pymike <pymike93@xxxxxxxxx> wrote:
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/)



--
- pymike (http://pymike.4rensics.org/)