資源簡(jiǎn)介
前段時(shí)間寫的射箭小游戲,射箭動(dòng)作以及箭的拋物線運(yùn)動(dòng)以及隨著運(yùn)動(dòng)改變狀態(tài),碰撞升級(jí)等均已實(shí)現(xiàn)。
代碼片段和文件信息
#include?“AppDelegate.h“
#include?“GameLogo.h“
//?#define?USE_AUDIO_ENGINE?1
//?#define?USE_SIMPLE_AUDIO_ENGINE?1
#if?USE_AUDIO_ENGINE?&&?USE_SIMPLE_AUDIO_ENGINE
#error?“Don‘t?use?AudioEngine?and?SimpleAudioEngine?at?the?same?time.?Please?just?select?one?in?your?game!“
#endif
#if?USE_AUDIO_ENGINE
#include?“audio/include/AudioEngine.h“
using?namespace?cocos2d::experimental;
#elif?USE_SIMPLE_AUDIO_ENGINE
#include?“audio/include/SimpleAudioEngine.h“
using?namespace?CocosDenshion;
#endif
USING_NS_CC;
static?cocos2d::Size?designResolutionSize?=?cocos2d::Size(640?480);
static?cocos2d::Size?smallResolutionSize?=?cocos2d::Size(640?480);
static?cocos2d::Size?mediumResolutionSize?=?cocos2d::Size(1024?768);
static?cocos2d::Size?largeResolutionSize?=?cocos2d::Size(2048?1536);
AppDelegate::AppDelegate()
{
}
AppDelegate::~AppDelegate()?
{
#if?USE_AUDIO_ENGINE
????AudioEngine::end();
#elif?USE_SIMPLE_AUDIO_ENGINE
????SimpleAudioEngine::end();
#endif
}
//?if?you?want?a?different?context?modify?the?value?of?glContextAttrs
//?it?will?affect?all?platforms
void?AppDelegate::initGLContextAttrs()
{
????//?set?OpenGL?context?attributes:?redgreenbluealphadepthstencil
????GLContextAttrs?glContextAttrs?=?{8?8?8?8?24?8};
????GLView::setGLContextAttrs(glContextAttrs);
}
//?if?you?want?to?use?the?package?manager?to?install?more?packages??
//?don‘t?modify?or?remove?this?function
static?int?register_all_packages()
{
????return?0;?//flag?for?packages?manager
}
bool?AppDelegate::applicationDidFinishLaunching()?{
????//?initialize?director
????auto?director?=?Director::getInstance();
????auto?glview?=?director->getOpenGLView();
????if(!glview)?{
#if?(CC_TARGET_PLATFORM?==?CC_PLATFORM_WIN32)?||?(CC_TARGET_PLATFORM?==?CC_PLATFORM_MAC)?||?(CC_TARGET_PLATFORM?==?CC_PLATFORM_LINUX)
????????glview?=?GLViewImpl::createWithRect(“GameLogo“?cocos2d::Rect(0?0?designResolutionSize.width?designResolutionSize.height));
#else
????????glview?=?GLViewImpl::create(“GameLogo“);
#endif
????????director->setOpenGLView(glview);
????}
????//?turn?on?display?FPS
????director->setDisplayStats(true);
????//?set?FPS.?the?default?value?is?1.0/60?if?you?don‘t?call?this
????director->setAnimationInterval(1.0f?/?60);
????//?Set?the?design?resolution
glview->setDesignResolutionSize(designResolutionSize.width?designResolutionSize.height?ResolutionPolicy::NO_BORDER);
????auto?frameSize?=?glview->getframeSize();
????//?if?the?frame‘s?height?is?larger?than?the?height?of?medium?size.
????if?(frameSize.height?>?mediumResolutionSize.height)
????{????????
????????director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height?largeResolutionSize.width/designResolutionSize.width));
????}
????//?if?the?frame‘s?height?is?larger?than?the?height?of?small?size.
????else?if?(frameSize.height?>?smallResolutionSize.height)
????{????????
????????director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height?mediumResolutionSize.width
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????6148??2017-07-04?08:57??Resources\.DS_Store
?????文件????????259??2018-05-02?14:21??Resources\Data\GateData.json
?????文件???????1235??2018-05-04?11:11??Resources\Data\ResData.json
?????文件?????778552??2017-07-04?08:57??Resources\fonts\arial.ttf
?????文件???41480108??2015-05-22?16:08??Resources\fonts\GFPMTZT_.ttf
?????文件??????25776??2017-07-04?08:57??Resources\fonts\Marker?Felt.ttf
?????文件????7481300??2006-05-30?16:01??Resources\fonts\華康金文體W31.ttf
?????文件?????????88??2018-01-30?10:14??Resources\fonts\華康金文體W31.ttf.me
?????文件????????879??2018-05-02?19:23??Resources\image\Arrow?(2).png
?????文件??????21799??2017-07-04?08:57??Resources\image\Arrow.png
?????文件?????189473??2017-07-04?08:57??Resources\image\background.png
?????文件?????448048??2018-04-26?19:10??Resources\image\background_01.png
?????文件??????22430??2018-05-02?14:31??Resources\image\background_01Bk.png
?????文件?????390100??2018-04-26?19:10??Resources\image\background_02.png
?????文件??????20727??2018-05-02?14:41??Resources\image\background_02Bk.png
?????文件?????387391??2018-04-26?19:11??Resources\image\background_03.png
?????文件??????22680??2018-05-02?14:42??Resources\image\background_03Bk.png
?????文件?????417784??2018-04-26?19:10??Resources\image\background_04.png
?????文件??????22299??2018-05-02?14:42??Resources\image\background_04Bk.png
?????文件?????322223??2018-04-26?19:13??Resources\image\bg.png
?????文件??????24152??2017-07-04?08:57??Resources\image\complete.png
?????文件??????23168??2017-07-04?08:57??Resources\image\conthover.png
?????文件??????23648??2017-07-04?08:57??Resources\image\contnormal.png
?????文件??????25400??2017-07-04?08:57??Resources\image\DownBody.png
?????文件??????26476??2017-07-04?08:57??Resources\image\gameover.png
?????文件??????29889??2018-04-26?17:02??Resources\image\loding.png
?????文件??????28244??2018-04-25?20:24??Resources\image\lodingBg.png
?????文件??????21712??2017-07-04?08:57??Resources\image\mainmenuhover.png
?????文件??????21883??2017-07-04?08:57??Resources\image\mainmenunormal.png
?????文件??????38280??2017-07-04?08:57??Resources\image\mamdie1\mandie1_1.png
............此處省略99個(gè)文件信息
評(píng)論
共有 條評(píng)論