Public Member Functions | |
def | __init__ |
def | addObject |
def | removeObject |
def | introduction |
def | catchingUp |
Static Public Member Functions | |
def | getLayerByName |
Public Attributes | |
layername | |
The Layer's name. | |
objects | |
A list of the GameObjects in the Layer. | |
Static Public Attributes | |
list | layers = [] |
The list of Layers. |
A layer is a set of GameObjects. Grouping objects in layers can save CPU time
def GameObject.Layer.__init__ | ( | self, | |
layername, | |||
initialobjects | |||
) |
Layer.__init__(self, layername, objects) Initialization funciton. layername is the Layer's name initialobjects is a list of GameObjects that belong to the Layer
def GameObject.Layer.addObject | ( | self, | |
obj | |||
) |
Layer.addObject(self, obj) A function that adds a GameObject obj to a Layer Returns True if the object is successfully added and False otherwise
def GameObject.Layer.catchingUp | ( | self | ) |
Generates a JSON friendly dictionary with all the object's attributes and values. This function is intended as a update on the object's state, sent to receivers that are already able to identify the object.
def GameObject.Layer.getLayerByName | ( | layername | ) | [static] |
Layer.getLayerByName(layername) [STATIC] Returns a Layer object given its name layername. Returns None if there's no layer by that name
def GameObject.Layer.introduction | ( | self | ) |
Generates a JSON friendly dictionary with all the object's attributes and values. This function is intended as a first introduction of the object, to receivers that are unaware of its existence.
def GameObject.Layer.removeObject | ( | self, | |
obj | |||
) |
Layer.removeObject(self, obj) A function that removes a GameObject obj from a Layer