pygamelib.actuators.UnidirectionalActuator¶
-
class
pygamelib.actuators.
UnidirectionalActuator
(direction=10000100, parent=None)¶ A class that implements a single movement.
The unidirectional actuator is a subclass of
Actuator
. It is simply implementing a mono directional movement. It is primarily target at projectiles.Parameters: - direction (int) – A single direction from the Constants module.
- parent (pygamelib.board_items.BoardItem) – The parent object to actuate.
-
__init__
(direction=10000100, parent=None)¶ The constructor take only one (positional) parameter: the parent object.
Important
The default state of ALL actuators is RUNNING. If you want your actuator to be in a different state (PAUSED for example), you have to do it yourself.
Methods
__init__
([direction, parent])The constructor take only one (positional) parameter: the parent object. next_move
()Return the direction. pause
()Set the actuator state to PAUSED. start
()Set the actuator state to RUNNING. stop
()Set the actuator state to STOPPED.