Home | Trees | Index | Help |
---|
Package pygsear :: Module Game :: Class Game |
|
GameLooper
--+
|
Game
TwistedGame
The central game object.
Classes which subclass this take part in the pygsear game framework and automatically get a splash screen, and the configuration interface.Method Summary | |
---|---|
__init__(self,
window)
| |
Bring up the configuration screen | |
Stop capturing all input | |
Show a Game Over message. | |
Capture all mouse and keyboard input | |
Hide the mouse cursor | |
Further initialization | |
The main game loop. | |
Ask if player wants to play again. | |
Fix up the game after the screen has been resized | |
restart(self)
| |
Set the background. | |
set_title(self,
title)
| |
Show the mouse cursor | |
Show the splash screen | |
Erase the splash screen | |
Take one trip through the mainloop | |
unpause(self)
| |
update the display | |
Pause the game, waiting for a keystroke. | |
Inherited from GameLooper | |
return a Event.EventGroup | |
return a SpriteGroup | |
return a Drawable.Layer and keep track. | |
| |
Defaults to no collision checks. | |
| |
| |
| |
set the .quit attribute. | |
set the .stop attribute. |
Class Variable Summary | |
---|---|
str |
splash_filename = 'pygsear_logo.png'
|
Method Details |
---|
configure(self, pygame_event, **kwargs)Bring up the configuration screen |
freeMouse(self, free=1)Stop capturing all input
|
gameOver(self)Show a Game Over message. |
grabMouse(self, grab=1)Capture all mouse and keyboard input Also keeps mouse locked inside of window.
|
hideMouse(self, hide=1)Hide the mouse cursor
|
initialize(self)Further initialization Most games will create their main objects here. |
mainloop(self, frames=0)The main game loop.
|
playAgain(self)Ask if player wants to play again. |
resize_reset(self)Fix up the game after the screen has been resized |
set_background(self, filename=None, img=None, tilename=None, tile=None, color=(0, 0, 0))Set the background.
|
showMouse(self, show=1)Show the mouse cursor
|
splash_screen(self)Show the splash screen Called as soon as window is created Game subclasses which do not want a splash screen can override this with a function that just does pass |
splash_screen_poof(self)Erase the splash screen Called at the end of __init__ Game subclasses which do not want a splash screen should also override this with a function that just does pass |
step(self)Take one trip through the mainloop |
update(self, areas=None)update the display
|
waitFor(self, key=13, timeout=None)Pause the game, waiting for a keystroke. Still allows the game to be ended by clicking the window close button. |
Class Variable Details |
---|
splash_filename
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.0 on Sat Dec 9 14:11:20 2006 | http://epydoc.sf.net |