Class cocos.actions.base_actions.Action

Known Subclasses:
IntervalAction, move_actions.Move, move_actions.Driver, Loop_Action, Repeat, Sequence_Action, Spawn_Action
The most general action

Methods

  __init__(self, *args, **kwargs)
dont override - use init
  init(*args, **kwargs)
Gets called by __init__ with all the parameteres received, At this time the target for the action is unknown.
  start(self)
External code sets self.target and then calls this method.
  stop(self)
When the action must cease to perform this function is called by external code; after this call no other method should be called.
  step(self, dt)
Gets called every frame.
  done(self)
False while the step method must be called.
  __add__(self, action)
sequence operator - concatenates actions action1 + action2 -> action_result where action_result performs as: first do all that action1 would do; then perform all that action2 would do
  __mul__(self, other)
repeats ntimes the action action * n -> action_result where action result performs as: repeat n times the changes that action would do
  __or__(self, action)
spawn operator - runs two actions in parallel action1 | action2 -> action_result
  __reversed__(self)

Instance Variables

  target
CocosNode object that is the target of the action

Method Details

init

init(*args, **kwargs)
Gets called by __init__ with all the parameteres received, At this time the target for the action is unknown. Typical use is store parameters needed by the action.

start

start(self)
External code sets self.target and then calls this method. Perform here any extra initialization needed.