cocos.actions.tiledgrid_actions module

Implementation of TiledGrid3DAction actions

class FadeOutTRTiles(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

Fades out each tile following a diagonal Top-Right path until all the tiles are faded out.

Example:

scene.do(FadeOutTRTiles(grid=(16,12), duration=10))
test_func(i, j, t)
transform_tile(x, y, t)
turn_off_tile(x, y)
turn_on_tile(x, y)
update(t)
class FadeOutBLTiles(*args, **kwargs)

Bases: cocos.actions.tiledgrid_actions.FadeOutTRTiles

Fades out each tile following an Bottom-Left path until all the tiles are faded out.

Example:

scene.do(FadeOutBLTiles(grid=(16,12), duration=5))
test_func(i, j, t)
class FadeOutUpTiles(*args, **kwargs)

Bases: cocos.actions.tiledgrid_actions.FadeOutTRTiles

Fades out each tile following an upwards path until all the tiles are faded out.

Example:

scene.do(FadeOutUpTiles(grid=(16,12), duration=5))
test_func(i, j, t)
transform_tile(x, y, t)
class FadeOutDownTiles(*args, **kwargs)

Bases: cocos.actions.tiledgrid_actions.FadeOutUpTiles

Fades out each tile following an downwards path until all the tiles are faded out.

Example:

scene.do(FadeOutDownTiles(grid=(16,12), duration=5))
test_func(i, j, t)
class ShuffleTiles(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

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))
init(seed=-1, *args, **kw)
Parameters:
seed
: float

Seed for the random in the shuffle.

place_tile(i, j)
start()
update(t)
class TurnOffTiles(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

TurnOffTiles turns off each in random order

Example:

scene.do(TurnOffTiles(grid=(16,12), seed=1, duration=10))
get_tile_pos(idx)
init(seed=-1, *args, **kw)
start()
turn_off_tile(t)
turn_on_tile(t)
update(t)
class SplitRows(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

Split the screen in a number of rows, and move these rows away from the screen.

The odds rows are moved to the left, while the even rows are moved to the right.

Example:

scene.do(SplitRows(rows=3, duration=2))
init(rows=9, grid=(-1, -1), *args, **kw)
Parameters:
rows
: int

Number of rows that will have the effect. Default: 9

update(t)
class SplitCols(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

Split the screen in a number of columns, and move these columns away from the screen.

The odds columns are moved to the upwards, while the even columns are moved to the downwards.

Example:

scene.do(SplitCols(cols=3, duration=2))
init(cols=9, grid=(-1, -1), *args, **kw)
Parameters:
cols
: int

Number of columns that will have the effect. Default: 9

update(t)
class ShakyTiles3D(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

Simulates a shaky floor composed of tiles

Example:

scene.do(ShakyTiles3D(randrange=6, grid=(4,4), duration=10))
init(randrange=6, *args, **kw)
Parameters:
randrange
: int

Number that will be used in random.randrange(-randrange, randrange) to do the effect

update(t)
class ShatteredTiles3D(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

ShatterTiles shatters the tiles according to a random value. It is similar to shakes (see ShakyTiles3D) the tiles just one frame, and then continue with that state for duration time.

Example:

scene.do(ShatteredTiles3D(randrange=12))
init(randrange=6, *args, **kw)
Parameters:
randrange
: int

Number that will be used in random.randrange(-randrange, randrange) to do the effect

update(t)
class WavesTiles3D(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

Simulates waves using the math.sin() function in the z-axis of each tile

Example:

scene.do(WavesTiles3D(waves=5, amplitude=120, grid=(16,16), duration=10))
init(waves=4, amplitude=120, *args, **kw)
Parameters:
waves
: int

Number of waves (2 * pi) that the action will perform. Default is 4

amplitude
: int

Wave amplitude (height). Default is 20

update(t)
class JumpTiles3D(*args, **kwargs)

Bases: cocos.actions.basegrid_actions.TiledGrid3DAction

Odd tiles will perform a jump in the z-axis using the sine function, while the even tiles will perform a jump using sine+pi function

Example:

scene.do(JumpTiles3D(jumps=5, amplitude=40, grid=(16,16), duration=10))
init(jumps=4, amplitude=20, *args, **kw)
Parameters:
jumps
: int

Number of jumps(2 * pi) that the action will perform. Default is 4

amplitude
: int

Wave amplitude (height). Default is 20

update(t)