Module MyScene :: Class MY_SingleScene
[hide private]
[frames] | no frames]

Class MY_SingleScene

source code

object --+
         |
        MY_SingleScene

singleton class of the used game scene to hold all the created objects

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
addObject(self, my_object=None)
adds a given object to his predefined list
source code
 
removeObject(self, my_object=None)
removes an object from his scene list
source code
 
__getitem__(self, item)
only for non passive elements, passive lements can be searched by id (.getMyPassiveObjectById())
source code
MY_GameObject
getMyPassiveObjectById(self, object_id)
gets a passive object by it's given id, like platforms and stairs
source code
MY_GameObject
getMyActiveTempObjectById(self, item_id)
gets a temporary active object by it's given id, like items
source code
 
freeLists(self)
free the lists and destroy all game objects (when game is over for example)
source code

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

Static Methods [hide private]
a new object with type S, a subtype of T
__new__(self, *args, **kargs) source code
Class Variables [hide private]
  __instance = None
Instance Variables [hide private]
List objectsActive
all objects that are active like player and the universe sphere
List objectsActiveTemp
all objects that are temporary available in the game scene like items, hurdle, gauge
List objectsCamera
all cameras in the game scene
List objectsLight
all the lights in the game scene
List objectsMerch
all objects that are classified as xItem and were spawned into game scene
List objectsPassive
all stairs and platforms in the game scene
KX_Scene scene
holds the blender game scene
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(self, *args, **kargs)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

addObject(self, my_object=None)

source code 

adds a given object to his predefined list

Parameters:
  • my_object (MY_GameObject) - the object that shall be added to the scene

removeObject(self, my_object=None)

source code 

removes an object from his scene list

Parameters:
  • my_object (MY_GameObject) - the object that shall be removed from the scene

getMyPassiveObjectById(self, object_id)

source code 

gets a passive object by it's given id, like platforms and stairs

Parameters:
  • object_id (Integer) - the id of a passive object
Returns: MY_GameObject
returns the passive object that goes with the given id

getMyActiveTempObjectById(self, item_id)

source code 

gets a temporary active object by it's given id, like items

Parameters:
  • item_id (Integer) - the id of a temporary active object
Returns: MY_GameObject
returns the temporary active object that goes with the given id