-
大小: 1.7MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-08-13
- 语言: Html/CSS
- 标签: cocos2d-x3.0 final 贪食蛇 项目
资源简介
Cocos2d-x3.0final 自学教程的配套代码http://blog.csdn.net/column/details/cocos2dx2014.html
代码片段和文件信息
#include “AppDelegate.h“
#include “MainMenu.h“
#include “SimpleAudioEngine.h“
USING_NS_CC;
using namespace CocosDenshion;
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate()
{
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create(“My Game“);
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don‘t call this
director->setAnimationInterval(1.0 / 60);
// create a scene. it‘s an autorelease object
auto scene = MainMenu::createScene();
// run
director->runWithScene(scene);
//开始播放背景音乐
SimpleAudioEngine::getInstance()->playBackgroundMusic(“background.mp3“);
return true;
}
// This function will be called when the app is inactive. When comes a phone callit‘s be invoked too
void AppDelegate::applicationDidEnterBackground() {
Director::getInstance()->stopAnimation();
// if you use SimpleAudioEngine it must be pause
SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
Director::getInstance()->startAnimation();
// if you use SimpleAudioEngine it must resume here
SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-05-29 15:52 Classes\
文件 1524 2014-05-29 15:49 Classes\AppDelegate.cpp
目录 0 2014-05-30 10:22 __MACOSX\
目录 0 2014-05-30 10:22 __MACOSX\Classes\
文件 171 2014-05-29 15:49 __MACOSX\Classes\._AppDelegate.cpp
文件 947 2014-04-01 18:48 Classes\AppDelegate.h
文件 8692 2014-05-29 15:52 Classes\GameScene.cpp
文件 171 2014-05-29 15:52 __MACOSX\Classes\._GameScene.cpp
文件 1073 2014-05-28 10:09 Classes\GameScene.h
文件 171 2014-05-28 10:09 __MACOSX\Classes\._GameScene.h
文件 1292 2014-05-27 16:28 Classes\HelpScene.cpp
文件 171 2014-05-27 16:28 __MACOSX\Classes\._HelpScene.cpp
文件 382 2014-05-27 15:54 Classes\HelpScene.h
文件 171 2014-05-27 15:54 __MACOSX\Classes\._HelpScene.h
文件 1686 2014-05-27 16:10 Classes\MainMenu.cpp
文件 171 2014-05-27 16:10 __MACOSX\Classes\._MainMenu.cpp
文件 385 2014-05-27 15:43 Classes\MainMenu.h
文件 171 2014-05-27 15:43 __MACOSX\Classes\._MainMenu.h
目录 0 2014-05-29 15:43 Resources\
文件 6148 2014-05-15 09:03 Resources\.DS_Store
文件 1456587 2001-07-13 14:18 Resources\background.mp3
目录 0 2014-05-30 10:22 __MACOSX\Resources\
文件 240 2001-07-13 14:18 __MACOSX\Resources\._background.mp3
文件 6311 2014-04-01 18:48 Resources\CloseNormal.png
文件 5499 2014-04-01 18:48 Resources\CloseSelected.png
文件 15404 2000-03-06 23:00 Resources\eat.wav
文件 240 2000-03-06 23:00 __MACOSX\Resources\._eat.wav
目录 0 2014-04-25 19:40 Resources\fonts\
文件 25776 2014-04-01 18:48 Resources\fonts\Marker Felt.ttf
文件 655 2013-12-01 11:45 Resources\greenstar.png
文件 138777 2014-04-01 18:48 Resources\HelloWorld.png
............此处省略4个文件信息
- 上一篇:检察院案件管理系统 HTML
- 下一篇:MKVtoolnix2.2.0完美汉化版
评论
共有 条评论