Class cocos.actions.tiledgrid_actions.ShuffleTiles

             object --+                
                      |                
    base_actions.Action --+            
                          |            
base_actions.IntervalAction --+        
                              |        
basegrid_actions.GridBaseAction --+    
                                  |    
 basegrid_actions.TiledGrid3DAction --+
                                      |
                                     ShuffleTiles

ShuffleTiles moves the tiles randomly across the screen. To put them back use: Reverse( ShuffleTiles() ) with the same seed parameter.

Example:

scene.do( ShuffleTiles( grid=(4,4), seed=1, duration=10) )

Methods

  init(self, seed=-1, *args, **kw)
Initialize the Grid Action
  start(self)
Before we start executing an action, self.target is assigned and this method is called.
  place_tile(self, i, j)
  update(self, t)
Gets called on every frame.
Inherited from basegrid_actions.TiledGrid3DAction: get_grid, get_original_tile, get_tile, set_tile Inherited from basegrid_actions.GridBaseAction: __reversed__ Inherited from base_actions.IntervalAction: done Inherited from base_actions.Action: __add__, __init__, __mul__, __or__, step, stop Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Instance Variables

Inherited from base_actions.Action: target

Method Details

init

init(self, seed=-1, *args, **kw)
Initialize the Grid Action
Parameters:
seed : float
Seed for the random in the shuffle.
Overrides:
basegrid_actions.GridBaseAction.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:
basegrid_actions.GridBaseAction.start

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:
base_actions.IntervalAction.update