pygamelib.actuators.PathActuator¶
-
class
pygamelib.actuators.
PathActuator
(path=None, parent=None)¶ The path actuator is a subclass of
Actuator
. The move inside the function next_move depends on path and index. If the state is not running it returns None otherwise it increments the index & then, further compares the index with length of the path. If they both are same then, index is set to value zero and the move is returned back.Parameters: - path (list) – A list of paths.
- parent (pygamelib.board_items.BoardItem) – The parent object to actuate.
-
__init__
(path=None, 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__
([path, parent])The constructor take only one (positional) parameter: the parent object. next_move
()Return the movement based on current index pause
()Set the actuator state to PAUSED. set_path
(path)Defines a new path start
()Set the actuator state to RUNNING. stop
()Set the actuator state to STOPPED.