91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 13.73MB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2023-08-01
  • 語言: 其他
  • 標簽: cocos2d-x??源碼??

資源簡介

自己寫了一個簡單的小程序,其中有不足之處,望諒解,本程序只供對cocos2d-x游戲開發者學習使用;開發環境xcode4.5 coco2d-x

資源截圖

代碼片段和文件信息

//
//??Bullet.cpp
//??PlantsVSZombies
//
//??Created?by?user?on?13-6-5.
//
//

#include?“Bullet.h“

extern?CCArray*?bulletArray;

Bullet::Bullet(Plants?*aplantsCCPoint?pCClayer?*layer)
{
????plants?=?new?Plants(aplants->plantsName);
????switch?(aplants->plantsName)
????{
????????case?Sunflower:
????????{
????????????this->creatSunflowerBullet(player);
????????????break;
????????}
????????case?SmallPea:
????????case?MiddlePea:
????????case?ThreeBulletPea:
????????{
????????????this->creatPeaBullet(p?layer);
????????????break;
????????}
????????default:
????????????break;
????}
}

Bullet::~Bullet()
{
????delete?plants;
}

void?Bullet::creatSunflowerBullet(CCPoint?pCClayer?*layer)
{
????CCSpriteframeCache?*cache?=?CCSpriteframeCache::sharedSpriteframeCache();
????cache->addSpriteframesWithFile(“Sun_default.plist“);
????this->initWithSpriteframeName(“Sun-1(被拖移).tiff“);
????this->setScale(0.5);
????
????char?temp[50];
????CCArray?*plistArray?=?CCArray::createWithCapacity(10);
????for(int?i=1;i<22;i++)
????{
????????sprintf(temp?“Sun-%i(被拖移).tiff“i);
????????CCSpriteframe?*frame?=?cache->spriteframeByName(temp);
????????plistArray->addobject(frame);
????}
????CCAnimation?*animation?=?CCAnimation::createWithSpriteframes(plistArray0.15);
????CCAnimate?*animate?=?CCAnimate::create(animation);
????this->runAction(CCRepeatForever::create(animate));
????
????CCMenuItemSprite?*m?=?CCMenuItemSprite::create(this?this?this?menu_selector(Bullet::collectSunshine));
????m->setTag(4002);
????CCMenu?*menu?=?CCMenu::create(mNULL);
????menu->setPosition(ccp(p.x+20?p.y+30));
????menu->setEnabled(true);
????menu->setTag(4001);
????layer->addChild(menu);
????CCJumpTo?*jumpTo?=?CCJumpTo::create(1.0?ccp(menu->getPosition().x-40menu->getPosition().y-25)?30?1);
????menu->runAction(jumpTo);
????menu->setZOrder(1000);
}

void?Bullet::moveSunshine(CCNode?*senderCCMenu?*m)
{
????extern?int?SunNumber;
????SunNumber?=?SunNumber?+?50;
????m->removeFromParent();
}

void?Bullet::collectSunshine(CCNode?*sender)
{
????sender->stopAllActions();
????CCMoveTo?*moveTo?=?CCMoveTo::create(1.0?ccp(60?320));
????CCCallFuncND?*funcND?=?CCCallFuncND::create(this?callfuncND_selector(Bullet::moveSunshine)?sender->getParent());
????CCSequence?*seq?=?CCSequence::create(moveTofuncNDNULL);
????sender->getParent()->runAction(seq);
}

void?Bullet::creatPeaBullet(CCPoint?pCClayer?*layer)
{

????bulletArray->retain();
????position?=?p;
????
????CCSpriteframeCache?*cache?=?CCSpriteframeCache::sharedSpriteframeCache();
????cache->addSpriteframesWithFile(“PeashooterBullet_default.plist“);
????this->initWithSpriteframeName(“PeashooterBullet-1(被拖移).tiff“);
????this->setPosition(ccp(p.x+10?p.y+10));
????this->setScale(0.5);
????bulletArray->addobject(this);//把子彈添加到數組里邊
????layer->addChild(this);
????float?distance?=?500-this->getPosition().x;
????float?time?=?distance/BulletSpeedRatio;
????CCMoveTo?*moveTo?=?CCMoveTo::create(time?ccp(500this->getPosition().y));
????this->runAction(mov

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-11-16?14:29??PlantsVSZombies\
?????文件????????6148??2013-11-16?14:29??PlantsVSZombies\.DS_Store
?????目錄???????????0??2013-11-21?08:42??__MACOSX\
?????目錄???????????0??2013-11-21?08:42??__MACOSX\PlantsVSZombies\
?????文件??????????82??2013-11-16?14:29??__MACOSX\PlantsVSZombies\._.DS_Store
?????目錄???????????0??2013-11-21?08:40??PlantsVSZombies\PlantsVSZombies\
?????文件????????6148??2013-11-14?09:03??PlantsVSZombies\PlantsVSZombies\.DS_Store
?????目錄???????????0??2013-11-21?08:42??__MACOSX\PlantsVSZombies\PlantsVSZombies\
?????文件??????????82??2013-11-14?09:03??__MACOSX\PlantsVSZombies\PlantsVSZombies\._.DS_Store
?????文件????????4732??2013-11-19?09:45??PlantsVSZombies\PlantsVSZombies\Bullet.cpp
?????文件?????????171??2013-11-19?09:45??__MACOSX\PlantsVSZombies\PlantsVSZombies\._Bullet.cpp
?????文件?????????898??2013-11-15?20:00??PlantsVSZombies\PlantsVSZombies\Bullet.h
?????文件?????????171??2013-11-15?20:00??__MACOSX\PlantsVSZombies\PlantsVSZombies\._Bullet.h
?????目錄???????????0??2013-11-19?20:03??PlantsVSZombies\PlantsVSZombies\Classes\
?????文件????????4994??2013-11-19?20:03??PlantsVSZombies\PlantsVSZombies\Classes\AppDelegate.cpp
?????目錄???????????0??2013-11-21?08:42??__MACOSX\PlantsVSZombies\PlantsVSZombies\Classes\
?????文件?????????171??2013-11-19?20:03??__MACOSX\PlantsVSZombies\PlantsVSZombies\Classes\._AppDelegate.cpp
?????文件????????1183??2013-11-12?12:00??PlantsVSZombies\PlantsVSZombies\Classes\AppDelegate.h
?????文件?????????171??2013-11-12?12:00??__MACOSX\PlantsVSZombies\PlantsVSZombies\Classes\._AppDelegate.h
?????文件?????????331??2013-11-20?11:15??PlantsVSZombies\PlantsVSZombies\Data.h
?????文件?????????171??2013-11-20?11:15??__MACOSX\PlantsVSZombies\PlantsVSZombies\._Data.h
?????文件????????1747??2013-11-19?19:42??PlantsVSZombies\PlantsVSZombies\FailScene.cpp
?????文件?????????171??2013-11-19?19:42??__MACOSX\PlantsVSZombies\PlantsVSZombies\._FailScene.cpp
?????文件?????????442??2013-11-19?19:41??PlantsVSZombies\PlantsVSZombies\FailScene.h
?????文件?????????171??2013-11-19?19:41??__MACOSX\PlantsVSZombies\PlantsVSZombies\._FailScene.h
?????文件???????12453??2013-11-19?09:36??PlantsVSZombies\PlantsVSZombies\failscene.png
?????文件?????????177??2013-11-19?09:36??__MACOSX\PlantsVSZombies\PlantsVSZombies\._failscene.png
?????文件????????4507??2013-11-16?13:34??PlantsVSZombies\PlantsVSZombies\FinalWave.png
?????文件?????????177??2013-11-16?13:34??__MACOSX\PlantsVSZombies\PlantsVSZombies\._FinalWave.png
?????文件?????????229??2013-11-08?08:26??PlantsVSZombies\PlantsVSZombies\FlagMeterLevelProgress.png
?????文件?????????172??2013-11-08?08:26??__MACOSX\PlantsVSZombies\PlantsVSZombies\._FlagMeterLevelProgress.png
............此處省略1846個文件信息

評論

共有 條評論