..NAV

retrogamelib.gameobject

This module lets you easily add and remove objects to groups. This system is similar to pygame's Sprite module, yet simpler, and uses lists to store objects instead of dictionaries.
gameobject.Object(object)
__init__(groups)
Create a new Object. groups should be a list of Group objects, in which the Object is contained.
alive()
Check to see if the object is "alive", or contained in a group.
kill()
Removes the object from all of the groups it's been added to.
update()
Dummy function, meant to be overwritten and called once every frame.
draw(surface)
Another dummy function, meant to be overwritten and called for drawing.
gameobject.Group(object)
__init__()
Create a new Group.
__len__()
Allows you to execute: len(group_object).
__iter__()
Allows you to execute: for object in group_object:.
__getitem__(index)
Allows you to execute: group_object[i].
objects()
Returns a list of all the objects contained in the Group.
add(object)
Add an object to the group.
remove(object)
Remove an object from the group.


Copyright © 2009, pymike and saluk