Class cocos.actions.base_actions.Sequence

object --+        
         |        
    Action --+    
             |    
IntervalAction --+
                 |
                Sequence

Run actions sequentially: One after another You can sequence actions using:

Example:

action = Sequence( one, Sequence( two, three) )
sprite.do( action )

or:

sprite.do( one + two + three )

Methods

  init(self, one, two, **kwargs)
Init method
  start(self)
Before we start executing an action, self.target is assigned and this method is called.
  __repr__(self)
repr(x)
  update(self, t)
Gets called on every frame.
  stop(self)
After we finish executing an action this method is called.
  __reversed__(self)
  __add__(self, action)
Is the Sequence Action
(Inherited from cocos.actions.base_actions.Action)
  __init__(self, *args, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
(Inherited from cocos.actions.base_actions.Action)
  __mul__(self, other) (Inherited from cocos.actions.base_actions.Action)
  __or__(self, action)
Is the Spawn Action
(Inherited from cocos.actions.base_actions.Action)
  done(self) (Inherited from cocos.actions.base_actions.IntervalAction)
  step(self, dt)
Gets called every frame.
(Inherited from cocos.actions.base_actions.Action)
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

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

Method Details

init

init(self, one, two, **kwargs)
Init method
Parameters:
one : Action
The first action to execute
two : Action
The second action to execute
Overrides:
Action.init

start

start(self)
Before we start executing an action, self.target is assigned and this method is called. It will be called for every execution of the action.
Overrides:
Action.start

__repr__

(Representation operator) __repr__(self)
repr(x)
Overrides:
object.__repr__

update

update(self, t)
Gets called on every frame. t is in [0,1] If this action takes 5 seconds to execute, t will be equal to 0 at 0 seconds. t will be 0.5 at 2.5 seconds and t will be 1 at 5sec.
Overrides:
IntervalAction.update

stop

stop(self)
After we finish executing an action this method is called. It will be called for every execution of the action.
Overrides:
Action.stop

__reversed__

__reversed__(self)
Overrides:
Action.__reversed__