Package populusgui :: Module BehaviorBox :: Class BehaviorForm
[frames] | no frames]

Class BehaviorForm


Behavior Form which holds the list of behaviors and updates the list when the update method is called.

Instance Methods
 
__init__(self, entity=None)
Boolean
attachToEntity(self, entity)
Attach the behavior-list to the entity so that the behavior-list will be updated when the update method is called.
 
update(self, deltaTime)
Update the behavior-list using FREQUENCY constant to control the rate of update.
Class Variables
float FREQUENCY = 2.0
The frequency of updates of the behavior-list.
tuple RUNNING_COLOR = 1, 0, 0, 1
Color for running behaviors (R, G, B, Alpha).
tuple ACTIVE_COLOR = 0, 1, 0, 1
Color for active behaviors (R, G, B, Alpha).
tuple DISABLED_COLOR = 0.5, 0.5, 0, 1
Color for disabled behaviors (R, G, B, Alpha).
  COLORS = [(1, 0, 0, 1), (0, 1, 0, 1), (0.5, 0.5, 0, 1),]
Method Details

attachToEntity(self, entity)

 

Attach the behavior-list to the entity so that the behavior-list will be updated when the update method is called.

Parameters:
  • entity (Avatar) - The entity to attach to the behavior-list. The entity has have steering-behaviors, so for the moment there is a check if the entity is instance of Avatar.
Returns: Boolean
Returns True if entity is of right type and is attached, else False.

update(self, deltaTime)

 

Update the behavior-list using FREQUENCY constant to control the rate of update.

Parameters:
  • deltaTime (float) - The time between ticks of MainEngine.