pygamelib.actuators.RandomActuator¶
-
class
pygamelib.actuators.
RandomActuator
(moveset=None, parent=None)¶ A class that implements a random choice of movement.
The random actuator is a subclass of
Actuator
. It is simply implementing a random choice in a predefined move set.Parameters: - moveset (list) – A list of movements.
- parent (pygamelib.board_items.BoardItem) – The parent object to actuate.
-
__init__
(moveset=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__
([moveset, parent])The constructor take only one (positional) parameter: the parent object. next_move
()Return a randomly selected movement pause
()Set the actuator state to PAUSED. start
()Set the actuator state to RUNNING. stop
()Set the actuator state to STOPPED.