• 大小: 11.42MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-28
  • 语言: 其他
  • 标签: cocos2dx  塔防  

资源简介

cocos2dx 写的塔防游戏的例子,可以参考实现

资源截图

代码片段和文件信息

//
//  landscapeGameAppDelegate.cpp
//  landscapeGame
//
//  Created by cloud on 13-4-18.
//  Copyright __MyCompanyName__ 2013年. All rights reserved.
//

#include “AppDelegate.h“

#include “cocos2d.h“
#include “HMenu.h“
#include “SimpleAudioEngine.h“
using namespace CocosDenshion;
USING_NS_CC;

AppDelegate::AppDelegate()
{

}

AppDelegate::~AppDelegate()
{
}

bool AppDelegate::applicationDidFinishLaunching()
{
    // initialize director
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don‘t call this
    pDirector->setAnimationInterval(1.0 / 60);

    // create a scene. it‘s an autorelease object
    CCScene *pScene = HMenu::scene();

    // run
    pDirector->runWithScene(pScene);

    return true;
}

// This function will be called when the app is inactive. When comes a phone callit‘s be invoked too
void AppDelegate::applicationDidEnterBackground()
{
    CCDirector::sharedDirector()->pause();

    // if you use SimpleAudioEngine it must be paused
     SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
}

// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
    CCDirector::sharedDirector()->resume();
    
    // if you use SimpleAudioEngine it must resume here
     SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-04-18 11:04  towerlDefense\
     文件        6148  2013-04-18 13:46  towerlDefense\.DS_Store
     目录           0  2013-04-18 13:48  __MACOSX\
     目录           0  2013-04-18 13:48  __MACOSX\towerlDefense\
     文件          82  2013-04-18 13:46  __MACOSX\towerlDefense\._.DS_Store
     目录           0  2013-04-18 11:04  towerlDefense\landscapeGame\
     文件       12292  2013-04-18 13:48  towerlDefense\landscapeGame\.DS_Store
     目录           0  2013-04-18 13:48  __MACOSX\towerlDefense\landscapeGame\
     文件          82  2013-04-18 13:48  __MACOSX\towerlDefense\landscapeGame\._.DS_Store
     目录           0  2013-04-18 11:37  towerlDefense\landscapeGame\Classes\
     文件        6148  2013-04-18 11:17  towerlDefense\landscapeGame\Classes\.DS_Store
     目录           0  2013-04-18 13:48  __MACOSX\towerlDefense\landscapeGame\Classes\
     文件          82  2013-04-18 11:17  __MACOSX\towerlDefense\landscapeGame\Classes\._.DS_Store
     文件        1509  2013-04-18 11:37  towerlDefense\landscapeGame\Classes\AppDelegate.cpp
     文件         171  2013-04-18 11:37  __MACOSX\towerlDefense\landscapeGame\Classes\._AppDelegate.cpp
     文件        1147  2013-04-18 11:03  towerlDefense\landscapeGame\Classes\AppDelegate.h
     文件         171  2013-04-18 11:03  __MACOSX\towerlDefense\landscapeGame\Classes\._AppDelegate.h
     目录           0  2013-04-18 13:46  towerlDefense\landscapeGame\Classes\level\
     文件        6148  2013-04-18 11:22  towerlDefense\landscapeGame\Classes\level\.DS_Store
     目录           0  2013-04-18 13:48  __MACOSX\towerlDefense\landscapeGame\Classes\level\
     文件          82  2013-04-18 11:22  __MACOSX\towerlDefense\landscapeGame\Classes\level\._.DS_Store
     文件        3766  2013-04-18 13:46  towerlDefense\landscapeGame\Classes\level\HEnemy.cpp
     文件         171  2013-04-18 13:46  __MACOSX\towerlDefense\landscapeGame\Classes\level\._HEnemy.cpp
     文件         854  2013-04-18 11:24  towerlDefense\landscapeGame\Classes\level\HEnemy.h
     文件         171  2013-04-18 11:24  __MACOSX\towerlDefense\landscapeGame\Classes\level\._HEnemy.h
     文件        3400  2013-04-18 11:59  towerlDefense\landscapeGame\Classes\level\HTower.cpp
     文件         171  2013-04-18 11:59  __MACOSX\towerlDefense\landscapeGame\Classes\level\._HTower.cpp
     文件         894  2013-04-18 11:24  towerlDefense\landscapeGame\Classes\level\HTower.h
     文件         171  2013-04-18 11:24  __MACOSX\towerlDefense\landscapeGame\Classes\level\._HTower.h
     文件         821  2013-04-18 11:44  towerlDefense\landscapeGame\Classes\level\HWayPoint.cpp
     文件         171  2013-04-18 11:44  __MACOSX\towerlDefense\landscapeGame\Classes\level\._HWayPoint.cpp
............此处省略1015个文件信息

评论

共有 条评论