Module MyGameActiveHidden :: Class MY_GameItem
[hide private]
[frames] | no frames]

Class MY_GameItem

source code

MyGameObjects.MY_GameObjectActiveHidden --+
                                          |
                                         MY_GameItem

class of the game items that can be collected by the player and are positioned onm top/bottom of platforms

Instance Methods [hide private]
 
__init__(self, scene, element_name, parent_object) source code
Vector
getPosition(self)
get the world position of the item
source code
 
setPosition(self)
set an item at top or bottom of a parented platform
source code
 
setRotation(self)
sets the smooth infinite rotation in the right plane of the item object
source code
 
setParentStatus(self, has_item=False, item_object=None)
sets the staus of the parent object, if it has an item or not and when 'yes', assign the item to it
source code
 
deleteObject(self)
deletes object, removes it from the scene and frees its id
source code
    Inherited from MyGameObjects.MY_GameObjectActiveHidden
Boolean
getAlive(self, prota_pos)
checks if object's lifetime is expired or object is out of game view
source code
 
setLinearVelocity(self, speed, local=True)
just a forwarding of the blender setLinearVelocity
source code
Instance Variables [hide private]
MY_GameObject parentObject
the items parent object to know which object can be relieved of the item
Float positionRotationX
specifies the tilt of the item dependent on its ground plane
Float positionRotationY
specifies the tilt of the item dependent on its ground plane
Float rotationDuration
how long shall it take to make a full circle rotation
Float rotationStart
start time of the circle rotation
Integer (0,1,2) worldPlane
the number of the its current plane
    Inherited from MyGameObjects.MY_GameObjectActiveHidden
Integer elementId
the unique identifier for this object
KX_GameObject gObject
a blender game object
Integer lifeTime
specifies the lifetime of the spawned item (negative = infinite)
String name
the name that represents the object in MY_SingleScene
String type
a name which identifies the object as a specific class in MY_SingleScene
Method Details [hide private]

__init__(self, scene, element_name, parent_object)
(Constructor)

source code 
Parameters:
  • scene (KX_Scene) - the blender scene object which holds all objects
  • element_name (String) - the name of the light object which shall included into the MY_SingleScene class
  • parent_object (MY_GameObject) - the game object the item shall parented to
Overrides: MyGameObjects.MY_GameObjectActiveHidden.__init__

getPosition(self)

source code 

get the world position of the item

Returns: Vector
the vector of the current world position
Overrides: MyGameObjects.MY_GameObjectActiveHidden.getPosition

setParentStatus(self, has_item=False, item_object=None)

source code 

sets the staus of the parent object, if it has an item or not and when 'yes', assign the item to it

Parameters:
  • has_item (Boolean) - True if the parent object will have an assigned item
  • item_object (MY_GameObject) - normally this item (self)

deleteObject(self)

source code 

deletes object, removes it from the scene and frees its id

Overrides: MyGameObjects.MY_GameObjectActiveHidden.deleteObject