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

Class MY_GameHurdle

source code

MyGameObjects.MY_GameObjectActiveHidden --+
                                          |
                                         MY_GameHurdle

class of the enemy (hurdle) with its artificial intelligence or something like that ;)

Instance Methods [hide private]
 
__init__(self, scene, element_name, spawn_point) source code
 
setPosition(self, position)
sets the world position of the hurdle
source code
 
setOrientation(self, prota_pos)
sets the hurdle z-axis to the world gravity orientation, so the hurdle looks right
source code
String
setHurdle(self, prota_pos)
sets the hurdle onto the right way to the player
source code
 
setSpeedToPoint(self)
sets the vectored speed of the hurdle
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
Vector
getPosition(self)
gets the world position
source code
 
setLinearVelocity(self, speed, local=True)
just a forwarding of the blender setLinearVelocity
source code
Instance Variables [hide private]
MY_GameObject groundObject
the current ground object of the hurdle
Float speed
the speed of the hurdle
Vector targetPoint
the point the hurdle has to go to
    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
Integer (0,1,2) worldPlane
the number of the its current plane
Method Details [hide private]

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

source code 
Parameters:
  • scene (KX_Scene) - the blender scene object which holds all objects
  • element_name (String) - the name of the hurdle object which shall included into the MY_SingleScene class
  • spawn_point (KX_GameObject) - the object where the merch item shall be spawned
Overrides: MyGameObjects.MY_GameObjectActiveHidden.__init__

setPosition(self, position)

source code 

sets the world position of the hurdle

Parameters:
  • position (Vector) - the new position of the hurdle

setOrientation(self, prota_pos)

source code 

sets the hurdle z-axis to the world gravity orientation, so the hurdle looks right

Parameters:
  • prota_pos (Vector) - the position of the player, where the hurdle looks at

setHurdle(self, prota_pos)

source code 

sets the hurdle onto the right way to the player

  1. collision sphere (touch) detects items to eat and bullet hits
Parameters:
  • prota_pos (Vector) - the position of the object the hurdle is after
Returns: String
  1. 'nothing', if hurdle is up in the air and the 'bullet ohysic engine' takes over
  2. 'item', if hurdle hits an item
  3. 'ground', if hurdle hits the ground
  4. 'dead', if hurdle was hit by a bullet

deleteObject(self)

source code 

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

Overrides: MyGameObjects.MY_GameObjectActiveHidden.deleteObject