Package scripts :: Package objects :: Script base :: Class GameObject
[hide private]
[frames] | no frames]

Class GameObject

source code

object --+        
         |        
BaseObject --+    
             |    
 DynamicObject --+
                 |
                GameObject

A base class to be inherited by all game objects. This must be the first class (left to right) inherited by any game object.

Instance Methods [hide private]
 
__init__(self, ID, gfx=None, xpos=0.0, ypos=0.0, map_id=None, blocking=True, name="Generic object", real_name="Generic object", text="Item description", desc="Detailed description", **kwargs)
Set the basic values that are shared by all game objects.
source code
 
_getCoords(self)
Get-er property function
source code
 
_setCoords(self, coords)
Set-er property function
source code
 
__repr__(self)
A debugging string representation of the object
source code
 
getStateForSaving(self)
Returns state for saving
source code

Inherited from DynamicObject: __getstate__, __setstate__, prepareStateForSaving, restoreState

Inherited from BaseObject: trueAttr

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  coords = property(_getCoords, _setCoords, doc= "Property allow...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ID, gfx=None, xpos=0.0, ypos=0.0, map_id=None, blocking=True, name="Generic object", real_name="Generic object", text="Item description", desc="Detailed description", **kwargs)
(Constructor)

source code 

Set the basic values that are shared by all game objects.

Parameters:
  • ID (String) - Unique object identifier. Must be present.
  • gfx (Dictionary) - Dictionary with graphics for the different contexts @type coords 2-item tuple
  • coords - Initial coordinates of the object.
  • map_id (String) - Identifier of the map where the object is located
  • blocking (Boolean) - Whether the object blocks character movement
  • name (String) - The display name of this object (e.g. 'Dirty crate')
  • text (String) - A longer description of the item
  • desc (String) - A long description of the item that is displayed when it is examined
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

A debugging string representation of the object

Overrides: object.__repr__

getStateForSaving(self)

source code 

Returns state for saving

Overrides: BaseObject.getStateForSaving

Class Variable Details [hide private]

coords

Value:
property(_getCoords, _setCoords, doc= "Property allowing you to get an\
d set the object's \
                coordinates via tuples")