Package pygsear :: Module Game :: Class GameLooper
[show private | hide private]
[frames | no frames]

Class GameLooper

Known Subclasses:
GameConfiguration, Game

Abstract game control class
Method Summary
  __init__(self)
  addEventGroup(self, event)
return a Event.EventGroup
  addGroup(self, sprites, layer)
return a SpriteGroup
  addLayer(self, size)
return a Drawable.Layerand keep track.
  beep(self)
  checkCollisions(self)
Defaults to no collision checks.
  checkEvents(self)
  loop(self)
  pause(self)
  unpause(self)
  _quit(self, arg)
set the .quitattribute.
  _stop(self, arg)
set the .stopattribute.

Method Details

addEventGroup(self, event=())

return a Event.EventGroup

At this point, this is just a convenience to get a new Group, but it could at some point in the future keep track of all groups in the Game.

addGroup(self, sprites=[], layer=None)

return a SpriteGroup

At this point, this is just a convenience to get a new Group, but it could at some point in the future keep track of all groups in the Game.

addLayer(self, size=None)

return a Drawable.Layer and keep track.

Each Game has a list (.layers) of all the layers in the game.

checkCollisions(self)

Defaults to no collision checks.

Game.mainloop() will call this function once each time through the loop. Subclasses should override to check collisions and perform the needed actions.

_quit(self, arg=None)

set the .quit attribute.

This should cause a break on the next loop, and should also cause the Game to end and the program to exit.

_stop(self, arg=None)

set the .stop attribute.

This should cause a break on the next loop.

Generated by Epydoc 1.1 on Sun Nov 30 19:33:14 2003 http://epydoc.sf.net