首页 > 代码库 > 3.CCFadeOutTRTiles,部落格效果,跳动的方块特效,3D瓷砖晃动特效,破碎的3D瓷砖特效,瓷砖洗牌特效,分多行消失特效,分多列消失特效

3.CCFadeOutTRTiles,部落格效果,跳动的方块特效,3D瓷砖晃动特效,破碎的3D瓷砖特效,瓷砖洗牌特效,分多行消失特效,分多列消失特效



1 TiledGrid3D

//TiledGrid3D

//CCFadeOutTRTiles * action = CCFadeOutTRTiles::create(2,

CCSize(20,20));

//CCFadeOutBLTiles * action = CCFadeOutBLTiles::create(2,

CCSize(20,20));

//CCJumpTiles3D * action = CCJumpTiles3D::create(2,

CCSize(4,4),20,20);

//CCShakyTiles3D * action = CCShakyTiles3D::create(2, CCSize(20,

20), 30, false);

//CCShatteredTiles3D * action = CCShatteredTiles3D::create(2,

CCSize(20,20),20,false);

//CCShuffleTiles * action = CCShuffleTiles::create(2,

CCSize(20,20),2);

//CCSplitCols * action = CCSplitCols::create(2, 20);

//CCSplitRows * action = CCSplitRows::create(2, 20);

//CCTurnOffTiles * action = CCTurnOffTiles::create(2,

CCSize(20,20));

CCWavesTiles3D * action = CCWavesTiles3D::create(2,

CCSize(20,20),20,30);

spr->runAction(action);

 

部落网格效果,从左下角到右下角

CCActionInterval* fadeOutTRTiles = CCFadeOutTRTiles::create(5, CCSize(50, 50));

sp->runAction(fadeOutTRTiles);

//参数1:特效持续的时间

//参数2:网格大小

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCFadeOutTRTiles *action =CCFadeOutTRTiles::create(

       20,

       CCSize(20, 20));

 

   spr->runAction(action);

 

   returntrue;

}

运行结果:

跳动的方块特效

CCActionInterval* jumpTitles = CCJumpTitles3D::create(5,CCSize(20,20),5,20);

sp->runAction(jumpTiles);

作用:跳动的方格特效

参数1:特效持续的时间

参数2:网格的大小

参数3:跳动的次数

参数4:跳动的振幅

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCActionInterval*jumpTiles =CCJumpTiles3D::create(

       5,              //特效持续的时间

       CCSize(20,20), //网格的大小

       5,              //跳动的次数

       20);            //跳动的振幅

 

   spr->runAction(jumpTiles);

 

   returntrue;

}

3D瓷砖晃动特效

CCActionInterval* shakyTiles3D = CCShakyTiles3D::create(5, CCSize(10, 10), 5, false);

sp->runAction(shakyTiles3D);

作用:创建一个3d瓷砖晃动的特效

参数1:特效持续的时间

参数2:网格大小

参数3:晃动的范围

参数5:是否有z轴晃动

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCActionInterval*shakyTiles3D =CCShakyTiles3D::create(

       5,                //特效持续的时间

       CCSize(10, 10),  //网格大小

       5,                //晃动的范围

       false);          //是否有z轴晃动

 

   spr->runAction(shakyTiles3D);

 

   returntrue;

}

运行结果:

破碎的3D瓷砖特效 

CCActionInterval* shatteredTiles = CCShatteredTiles3D::create(15, CCSize(10, 10), 50, true); 

sp->runAction(shatteredTiles); 

作用:破碎的3D瓷砖特效

参数1:特效持续的时间

参数2:网格大小

参数3:范围

参数4:是否开启z

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCActionInterval*shatteredTiles =CCShatteredTiles3D::create(

       15,                  //特效持续的时间

       CCSize(10,10),      //网格大小

       50,                  //范围

       true);              //是否开启z

 

   spr->runAction(shatteredTiles);

 

   returntrue;

}

运行结果(特点是破碎的状态):

瓷砖洗牌特效:

CCActionInterval* shuffle = CCShuffleTiles::create(5, CCSize(50, 50), 50);

作用:瓷砖的洗牌特效

参数1:特效持续的时间

参数2:网格大小

参数3:随机数

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCActionInterval *shuffle =CCShuffleTiles::create(

       5,                //特效的持续时间

       CCSize(50,50),   //网格的大小

       50);              //随机数

 

   spr->runAction(shuffle);

 

   returntrue;

}

运行效果:

分多行消失特效

CCActionInterval* splitCols = CCSplitCols::create(5,50);

sp->runAction(splitCols);

作用:分多列消失特效

参数1:特效持续的时间

参数2:列数

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCActionInterval *splitCols =CCSplitCols::create(5,20);

 

   spr->runAction(splitCols);

 

   returntrue;

}

运行效果:

分多列消失特效 

CCActionInterval* splitRows = CCSplitRows::create(5, 50); 

sp->runAction(splitRows); 

 

作用:分多行消失特效

参数1:特效持续的时间

参数2:行数

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCActionInterval *splitRows =CCSplitRows::create(5, 50);

   

   spr->runAction(splitRows);

 

   returntrue;

}

运行结果:

方块消失特效

CCActionInterval* turnOffFiels = CCTurnOffTiles::create(4, CCSize(50, 50));

sp->runAction(turnOffFiles);

作用:方块消失特效

参数1:特效持续的时间

参数2:网络大小

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   CCActionInterval *turnOffFiles =CCTurnOffTiles::create(

       4,                 //特效持续的时间

       CCSize(50,50));   //网格大小

 

   spr->runAction(turnOffFiles);

 

   returntrue;

}

运行结果(渐渐消失):

3D瓷砖波动特效

CCActionInterval * turnOffFiles = CCTurnOffTiles::create(

4,

CCSize(10,10),

10,

20);

作用:创建一个3D瓷砖波动特效

参数1:特效持续时间

参数2:网格大小

参数3:波动的速率

参数4:振幅

#include"T18Grid3D.h"

#include"AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

   CCScene *scene =CCScene::create();

   T18Grid3D *layer =T18Grid3D::create();

   scene->addChild(layer);

   returnscene;

}

 

boolT18Grid3D::init()

{

   TBack::init();

   

   //Grid3D

   CCSprite *spr =CCSprite::create("HelloWorld.png");

   spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

   addChild(spr);

 

   //3D瓷砖波动特效

   CCActionInterval*wavesTiles3D =CCWavesTiles3D::create(

       5,               //特效持续时间

       CCSize(10, 10), //网格大小

       10,              //波动的速率

       20);             //振幅

 

   spr->runAction(wavesTiles3D);

 

   returntrue;

}

运行结果:

 

3.CCFadeOutTRTiles,部落格效果,跳动的方块特效,3D瓷砖晃动特效,破碎的3D瓷砖特效,瓷砖洗牌特效,分多行消失特效,分多列消失特效