守门员出场
守门员出场,每个守门员是从屏幕的右侧中间的位置随机方向向左侧移动
FielderSprite* fielderSprite1 = FielderSprite::create("pic/fielder.png");
//守门员精灵初始位置为右侧中间位置
fielderSprite1->setPosition(ccp(GOALKEEPER_X, GOALKEEPER_Y));
fielderSprite1->setAnchorPoint(ccp(0.5, 0.5));//默认锚点为0.5,0.5
//将fielder精灵添加到布景中
this->addChild(fielderSprite1, GAME_LEVEL_WYF);
动作序列中的6个动作,终点都在最左侧
CCActionInterval* at1=CCMoveBy::create(3.5,CCPointMake(-800,-170));
CCActionInterval* at2=CCMoveBy::create(4,CCPointMake(-800,-100));
CCActionInterval* at3=CCMoveBy::create(2.5,CCPointMake(-800,-30));
CCActionInterval* at4=CCMoveBy::create(4.5,CCPointMake(-800,40));
CCActionInterval* at5=CCMoveBy::create(5,CCPointMake(-800,110));
CCActionInterval* at6=CCMoveBy::create(3,CCPointMake(-800,180));
随机移动的6条线路
int r = rand()%6;
switch(r)
{
case 0:
fielderSprite1->runAction(at1);
fielderSprite1->ccat=at1;
fielderSprite1->mark=1;break;
case 1:
fielderSpr