Class cocos.actions.move_actions.Move

base_actions.Action --+
                      |
                     Move
Known Subclasses:
BoundedMove, WrappedMove

Move the target based on parameters on the target.

For movement the parameters are:

target.position = (x, y)
target.velocity = (dx, dy)
target.acceleration = (ddx, ddy) = (0, 0)
target.gravity = 0

And rotation:

target.rotation
target.dr
target.ddr

Methods

  step(self, dt)
Gets called every frame.
  __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
(Inherited from cocos.actions.base_actions.Action)
  __init__(self, *args, **kwargs)
dont override - use init
(Inherited from cocos.actions.base_actions.Action)
  __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
(Inherited from cocos.actions.base_actions.Action)
  __or__(self, action)
spawn operator - runs two actions in parallel action1 | action2 -> action_result
(Inherited from cocos.actions.base_actions.Action)
  __reversed__(self) (Inherited from cocos.actions.base_actions.Action)
  done(self)
False while the step method must be called.
(Inherited from cocos.actions.base_actions.Action)
  init(*args, **kwargs)
Gets called by __init__ with all the parameteres received, At this time the target for the action is unknown.
(Inherited from cocos.actions.base_actions.Action)
  start(self)
External code sets self.target and then calls this method.
(Inherited from cocos.actions.base_actions.Action)
  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.
(Inherited from cocos.actions.base_actions.Action)

Instance Variables

  target
CocosNode object that is the target of the action
(Inherited from cocos.actions.base_actions.Action)

Method Details

step

step(self, dt)
Gets called every frame. dt is the number of seconds that elapsed since the last call.
Overrides:
base_actions.Action.step