├── .cocos-project.json
├── .gitignore
├── .project
├── CMakeLists.txt
├── Classes
├── AppDelegate.cpp
├── AppDelegate.h
├── BulletLayer.cpp
├── BulletLayer.h
├── BulletUserData.cpp
├── BulletUserData.h
├── ControlLayer.cpp
├── ControlLayer.h
├── EnemyBulletLayer.cpp
├── EnemyBulletLayer.h
├── EnemyLayer.cpp
├── EnemyLayer.h
├── EnemyUserData.cpp
├── EnemyUserData.h
├── GameBackgroundLayer.cpp
├── GameBackgroundLayer.h
├── GameScene.cpp
├── GameScene.h
├── PlaneLayer.cpp
├── PlaneLayer.h
├── PlaneUserData.cpp
├── PlaneUserData.h
├── ResultBackgroundLayer.cpp
├── ResultBackgroundLayer.h
├── ResultButtonLayer.cpp
├── ResultButtonLayer.h
├── ResultScene.cpp
├── ResultScene.h
├── SelectBackgroundLayer.cpp
├── SelectBackgroundLayer.h
├── SelectButtonLayer.cpp
├── SelectButtonLayer.h
├── SelectScene.cpp
├── SelectScene.h
├── UFOLayer.cpp
├── UFOLayer.h
├── UFOUserData.cpp
├── UFOUserData.h
├── WelcomeBackgroundLayer.cpp
├── WelcomeBackgroundLayer.h
├── WelcomeButtonLayer.cpp
├── WelcomeButtonLayer.h
├── WelcomeScene.cpp
└── WelcomeScene.h
├── LICENSE
├── README.md
├── Resources
├── fonts
│ ├── MarkerFelt.ttf
│ └── SIMLI.TTF
├── texture.plist
└── texture.png
├── privateResources
├── FlyingACETexture.tps
├── HP.png
├── HPBottom.png
├── backToMenuButton.png
├── bigBomb.png
├── bigBombGet.png
├── blank.png
├── bossWarning.png
├── bullet1.png
├── bullet2.png
├── bullet3.png
├── bulletLevelUp1.png
├── bulletLevelUp2.png
├── bulletUpgrade.png
├── enemy1.png
├── enemy2.png
├── enemy3.png
├── enemyBoss.png
├── enemyBossBroken.png
├── enemyBossBrokenMore.png
├── enemyBulletSet.png
├── explosion01.png
├── explosion02.png
├── explosion03.png
├── explosion04.png
├── explosion05.png
├── explosion06.png
├── explosion07.png
├── explosion08.png
├── explosion09.png
├── getBigBomb1.png
├── getBigBomb2.png
├── img_bg_1.jpg
├── img_bg_2.jpg
├── img_bg_3.jpg
├── img_bg_4.jpg
├── img_bg_5.jpg
├── img_bg_welcome.jpg
├── launchButton.png
├── launchButtonUnable.png
├── locked.png
├── logo.png
├── logo.psd
├── myPlane.png
├── myPlane2.png
├── pauseButton.png
├── restartGameButton.png
├── selectSceneBackground.jpg
├── selectStartButton.png
├── startButton.png
└── startGameButton.png
└── proj.android
└── jni
└── Android.mk
/.cocos-project.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_type": "cpp"
3 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /cocos2d
2 | /proj.android/assets
3 | /proj.android/bin
4 | /proj.android/gen
5 | /proj.android/libs
6 | /proj.android/obj
7 | /proj.android/res
8 | /proj.android/src
9 | /proj.android/.settings
10 | /proj.android/AndroidManifest.xml
11 | /proj.android/ant.properties
12 | /proj.android/build.xml
13 | /proj.android/build-cfg.json
14 | /proj.android/build_native.py
15 | /proj.android/proguard-project.txt
16 | /proj.android/project.properties
17 | /proj.android/.classpath
18 | /proj.android/.cproject
19 | /proj.android/.project
20 | /proj.android/.pydevproject
21 | /proj.android/jni/hellocpp
22 | /proj.android/jni/Application.mk
23 | /proj.android/local.properties
24 |
25 | # Remove the Windows Thumbs.db
26 | Thumbs.db
27 | Classes/Thumbs.db
28 | privateResources/Thumbs.db
29 | Resources/Thumbs.db
30 |
31 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | FlyingACE-C++
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 | clean,full,incremental,
11 |
12 |
13 |
14 |
15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
16 | full,incremental,
17 |
18 |
19 |
20 |
21 |
22 | org.eclipse.cdt.core.cnature
23 | org.eclipse.cdt.core.ccnature
24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
26 |
27 |
28 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #/****************************************************************************
2 | # Copyright (c) 2013-2014 cocos2d-x.org
3 | #
4 | # http://www.cocos2d-x.org
5 | #
6 | # Permission is hereby granted, free of charge, to any person obtaining a copy
7 | # of this software and associated documentation files (the "Software"), to deal
8 | # in the Software without restriction, including without limitation the rights
9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | # copies of the Software, and to permit persons to whom the Software is
11 | # furnished to do so, subject to the following conditions:
12 |
13 | # The above copyright notice and this permission notice shall be included in
14 | # all copies or substantial portions of the Software.
15 |
16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | # THE SOFTWARE.
23 | # ****************************************************************************/
24 | cmake_policy(SET CMP0017 NEW)
25 |
26 | cmake_minimum_required(VERSION 2.8)
27 |
28 | set(APP_NAME MyGame)
29 | project (${APP_NAME})
30 |
31 | set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d)
32 |
33 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${COCOS2D_ROOT}/cmake/Modules/")
34 | include(CocosBuildHelpers)
35 |
36 | # libcocos2d
37 | set(BUILD_CPP_TESTS OFF CACHE BOOL "turn off build cpp-tests")
38 | set(BUILD_LUA_LIBS OFF CACHE BOOL "turn off build lua-tests")
39 | add_subdirectory(${COCOS2D_ROOT})
40 |
41 | # Some macro definitions
42 | if(WINDOWS)
43 | if(BUILD_SHARED_LIBS)
44 | ADD_DEFINITIONS (-D_USRDLL -D_EXPORT_DLL_ -D_USEGUIDLL -D_USREXDLL -D_USRSTUDIODLL)
45 | else()
46 | ADD_DEFINITIONS (-DCC_STATIC)
47 | endif()
48 |
49 | ADD_DEFINITIONS (-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32 -D_WIN32)
50 | set(PLATFORM_FOLDER win32)
51 | elseif(MACOSX OR APPLE)
52 | ADD_DEFINITIONS (-DCC_TARGET_OS_MAC)
53 | ADD_DEFINITIONS (-DUSE_FILE32API)
54 | set(PLATFORM_FOLDER mac)
55 | elseif(LINUX)
56 | ADD_DEFINITIONS(-DLINUX)
57 | set(PLATFORM_FOLDER linux)
58 | elseif(ANDROID)
59 | ADD_DEFINITIONS (-DUSE_FILE32API)
60 | set(PLATFORM_FOLDER android)
61 | else()
62 | message( FATAL_ERROR "Unsupported platform, CMake will exit" )
63 | endif()
64 |
65 |
66 | # Compiler options
67 | if(MSVC)
68 | ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
69 | -wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710
70 | -wd4514 -wd4056 -wd4996 -wd4099)
71 | else()
72 | set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1")
73 | set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
74 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions -std=c99")
75 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -std=c++11 -Wno-deprecated-declarations -Wno-reorder")
76 | if(CLANG)
77 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
78 | endif()
79 | endif(MSVC)
80 |
81 |
82 |
83 | set(PLATFORM_SPECIFIC_SRC)
84 | set(PLATFORM_SPECIFIC_HEADERS)
85 | if(MACOSX OR APPLE)
86 | set(PLATFORM_SPECIFIC_SRC
87 | proj.ios_mac/ios/main.m
88 | proj.ios_mac/ios/RootViewController.mm
89 | proj.ios_mac/ios/AppController.mm
90 | )
91 | set(PLATFORM_SPECIFIC_HEADERS
92 | proj.ios_mac/ios/RootViewController.h
93 | proj.ios_mac/ios/AppController.h
94 | )
95 | elseif(LINUX) #assume linux
96 | set(PLATFORM_SPECIFIC_SRC
97 | proj.linux/main.cpp
98 | )
99 | elseif ( WIN32 )
100 | set(PLATFORM_SPECIFIC_SRC
101 | proj.win32/main.cpp
102 | )
103 | set(PLATFORM_SPECIFIC_HEADERS
104 | proj.win32/main.h
105 | proj.win32/resource.h
106 | )
107 | endif()
108 |
109 | include_directories(
110 | /usr/local/include/GLFW
111 | /usr/include/GLFW
112 | ${COCOS2D_ROOT}/cocos
113 | Classes
114 | )
115 |
116 | set(GAME_SRC
117 | Classes/AppDelegate.cpp
118 | Classes/BulletLayer.cpp
119 | Classes/BulletUserData.cpp
120 | Classes/ControlLayer.cpp
121 | Classes/EnemyLayer.cpp
122 | Classes/EnemyUserData.cpp
123 | Classes/GameBackgroundLayer.cpp
124 | Classes/GameScene.cpp
125 | Classes/PlaneLayer.cpp
126 | Classes/PlaneUserData.cpp
127 | Classes/ResultButtonLayer.cpp
128 | Classes/ResultScene.cpp
129 | Classes/UFOLayer.cpp
130 | Classes/UFOUserData.cpp
131 | Classes/WelcomeButtonLayer.cpp
132 | Classes/WelcomeScene.cpp
133 | ${PLATFORM_SPECIFIC_SRC}
134 | )
135 |
136 | set(GAME_HEADERS
137 | Classes/AppDelegate.h
138 | Classes/BulletLayer.h
139 | Classes/BulletUserData.h
140 | Classes/ControlLayer.h
141 | Classes/EnemyLayer.h
142 | Classes/EnemyUserData.h
143 | Classes/GameBackgroundLayer.h
144 | Classes/GameScene.h
145 | Classes/PlaneLayer.h
146 | Classes/PlaneUserData.h
147 | Classes/ResultButtonLayer.h
148 | Classes/ResultScene.h
149 | Classes/UFOLayer.h
150 | Classes/UFOUserData.h
151 | Classes/WelcomeButtonLayer.h
152 | Classes/WelcomeScene.h
153 | ${PLATFORM_SPECIFIC_HEADERS}
154 | )
155 |
156 | if(GAME_HEADERS)
157 | add_executable(${APP_NAME} ${GAME_SRC} ${GAME_HEADERS})
158 | else()
159 | add_executable(${APP_NAME} ${GAME_SRC})
160 | endif()
161 |
162 | target_link_libraries(${APP_NAME} cocos2d)
163 |
164 | set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin")
165 |
166 | set_target_properties(${APP_NAME} PROPERTIES
167 | RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
168 |
169 | if ( WIN32 )
170 | #also copying dlls to binary directory for the executable to run
171 | pre_build(${APP_NAME}
172 | COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
173 | COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
174 | COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/gles/prebuilt/glew32.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE}
175 | COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/zlib/prebuilt/zlib1.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE}
176 | )
177 | else()
178 | pre_build(${APP_NAME}
179 | COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
180 | COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
181 | )
182 |
183 | endif()
184 |
--------------------------------------------------------------------------------
/Classes/AppDelegate.cpp:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 |
3 | USING_NS_CC;
4 |
5 | AppDelegate::~AppDelegate(){
6 | }
7 |
8 | //if you want a different context,just modify the value of glContextAttrs
9 | //it will takes effect on all platforms
10 | void AppDelegate::initGLContextAttrs() {
11 | //set OpenGL context attributions,now can only set six attributions:
12 | //red,green,blue,alpha,depth,stencil
13 | GLContextAttrs glContextAttrs = { 8, 8, 8, 8, 24, 8 };
14 | GLView::setGLContextAttrs(glContextAttrs);
15 | }
16 |
17 | bool AppDelegate::applicationDidFinishLaunching() {
18 | //载入XML初始化参数
19 | this->initConfigXML();
20 |
21 | // initialize director
22 | Director* director = Director::getInstance();
23 | auto glview = director->getOpenGLView();
24 | if (!glview) {
25 | glview = GLViewImpl::createWithRect("Flying ACE", Rect(0, 0, 720, 1280));
26 | director->setOpenGLView(glview);
27 | }
28 |
29 | // turn on display FPS
30 | director->setDisplayStats(true);
31 |
32 | // set FPS. the default value is 1.0/60 if you don't call this
33 | director->setAnimationInterval(1.0 / 60);
34 |
35 | //读取纹理贴度集合
36 | cocos2d::SpriteFrameCache::getInstance()->addSpriteFramesWithFile(UserDefault::getInstance()->getStringForKey("textureFileName"));
37 |
38 | //读取爆炸动画帧并存入AnimationCache
39 | Vector explosionAnimationVector;
40 | for (int i = 0; i < 9; i++){
41 | char animitionFileName[32] = {0};
42 | sprintf(animitionFileName, "explosion%02d.png", i+1);
43 | SpriteFrame* fm = SpriteFrameCache::getInstance()->getSpriteFrameByName(animitionFileName);
44 | explosionAnimationVector.pushBack(fm);
45 | }
46 | Animation* explosionAnimation = Animation::createWithSpriteFrames(explosionAnimationVector, 0.5f / 9.0f, 1);
47 | AnimationCache::getInstance()->addAnimation(explosionAnimation,"explosion");
48 |
49 | Scene* welcomeScene = WelcomeScene::create();
50 |
51 | // run
52 | director->runWithScene(welcomeScene);
53 |
54 | return true;
55 | }
56 |
57 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too
58 | void AppDelegate::applicationDidEnterBackground() {
59 | Director::getInstance()->stopAnimation();
60 |
61 | // if you use SimpleAudioEngine, it must be pause
62 | // SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
63 | }
64 |
65 | // this function will be called when the app is active again
66 | void AppDelegate::applicationWillEnterForeground() {
67 | Director::getInstance()->startAnimation();
68 |
69 | // if you use SimpleAudioEngine, it must resume here
70 | // SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
71 | }
72 |
73 |
74 | void AppDelegate::initConfigXML(){
75 | UserDefault::getInstance()->setStringForKey("textureFileName","texture.plist");
76 | UserDefault::getInstance()->setFloatForKey("intervalOfAddBullet",0.2f);
77 | //UserDefault::getInstance()->setFloatForKey("intervalOfAddCloud",20.0f);
78 | UserDefault::getInstance()->setFloatForKey("intervalOfAddEnemy", 0.5f);
79 | UserDefault::getInstance()->setFloatForKey("intervalOfAddEnemyBullet", 0.2f);
80 | UserDefault::getInstance()->setIntegerForKey("damageOfInitBullet",100);
81 | UserDefault::getInstance()->setIntegerForKey("damageOfDeltaWhenLevelUp", 50);
82 | UserDefault::getInstance()->setIntegerForKey("damageOfBigBomb", 400);
83 | UserDefault::getInstance()->setFloatForKey("probabilityOfBaseEnemyAppear", 0.4f);
84 | UserDefault::getInstance()->setFloatForKey("probabilityOfDeltaEnemyAppear", 0.007f);
85 | UserDefault::getInstance()->setIntegerForKey("HPOfEnemy1", 200);
86 | UserDefault::getInstance()->setIntegerForKey("HPOfEnemy2", 400);
87 | UserDefault::getInstance()->setIntegerForKey("HPOfEnemy3", 400);
88 | UserDefault::getInstance()->setIntegerForKey("HPOfEnemyBoss",18000);
89 | //UserDefault::getInstance()->setIntegerForKey("FlytimeOfCloud",35);
90 | UserDefault::getInstance()->setIntegerForKey("FlytimeOfEnemy1",10);
91 | UserDefault::getInstance()->setIntegerForKey("FlytimeOfEnemy2",10);
92 | UserDefault::getInstance()->setIntegerForKey("FlytimeOfEnemy3",5);
93 | UserDefault::getInstance()->setIntegerForKey("FlytimeOfEnemyBossAppear",7);
94 | UserDefault::getInstance()->setIntegerForKey("FlytimeOfGiftLevelUp",12);
95 | UserDefault::getInstance()->setIntegerForKey("FlytimeOfGiftBigBomb",12);
96 | }
97 |
--------------------------------------------------------------------------------
/Classes/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #ifndef _APP_DELEGATE_H_
2 | #define _APP_DELEGATE_H_
3 |
4 | #include "cocos2d.h"
5 | #include "GameScene.h"
6 | #include "WelcomeScene.h"
7 |
8 | /**
9 | @brief The cocos2d Application.
10 |
11 | The reason for implement as private inheritance is to hide some interface call by Director.
12 | */
13 | class AppDelegate: private cocos2d::Application {
14 | public:
15 | virtual ~AppDelegate();
16 |
17 | virtual void initGLContextAttrs();
18 |
19 | /**
20 | @brief Implement Director and Scene init code here.
21 | @return true Initialize success, app continue.
22 | @return false Initialize failed, app terminate.
23 | */
24 | virtual bool applicationDidFinishLaunching();
25 |
26 | /**
27 | @brief The function be called when the application enter background
28 | @param the pointer of the application
29 | */
30 | virtual void applicationDidEnterBackground();
31 |
32 | /**
33 | @brief The function be called when the application enter foreground
34 | @param the pointer of the application
35 | */
36 | virtual void applicationWillEnterForeground();
37 | private:
38 | //初始化XML配置信息
39 | void initConfigXML();
40 |
41 | cocos2d::SpriteFrameCache* textureCache = cocos2d::SpriteFrameCache::getInstance();
42 | //cocos2d::AnimationCache* animationCache = cocos2d::AnimationCache::getInstance();
43 | };
44 |
45 | #endif // _APP_DELEGATE_H_
46 |
47 |
--------------------------------------------------------------------------------
/Classes/BulletLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * BulletLayer.cpp
3 | *
4 | * Created on: 2015年1月16日
5 | * Author: netbeen
6 | */
7 |
8 | #include "BulletLayer.h"
9 |
10 | #include "PlaneLayer.h"
11 | #include "BulletUserData.h"
12 | #include "GameScene.h"
13 |
14 | USING_NS_CC;
15 |
16 | bool BulletLayer::init() {
17 | bulletTextureName.push_back("bullet1.png");
18 | bulletTextureName.push_back("bullet2.png");
19 | bulletTextureName.push_back("bullet3.png");
20 |
21 | bulletBatchNodeVector.push_back(SpriteBatchNode::createWithTexture(SpriteFrameCache::getInstance()->getSpriteFrameByName("bullet1.png")->getTexture()));
22 | bulletBatchNodeVector.push_back(SpriteBatchNode::createWithTexture(SpriteFrameCache::getInstance()->getSpriteFrameByName("bullet2.png")->getTexture()));
23 | bulletBatchNodeVector.push_back(SpriteBatchNode::createWithTexture(SpriteFrameCache::getInstance()->getSpriteFrameByName("bullet3.png")->getTexture()));
24 | bulletBatchNodeVector.push_back(SpriteBatchNode::createWithTexture(SpriteFrameCache::getInstance()->getSpriteFrameByName("bigBomb.png")->getTexture())); //定义大招层
25 |
26 | this->addChild(bulletBatchNodeVector[0]);
27 | this->addChild(bulletBatchNodeVector[1]);
28 | this->addChild(bulletBatchNodeVector[2]);
29 | this->addChild(bulletBatchNodeVector[3]); //大招层
30 |
31 | this->startShooting();
32 | return true;
33 | }
34 |
35 | void BulletLayer::addBullet(float useless) {
36 | Sprite* bullet = Sprite::createWithSpriteFrameName(bulletTextureName[nowBulletLevel]);
37 | Point planePosition = static_cast(this->getParent())->getPlaneLayer()->getChildByName("PLANE")->getPosition();
38 |
39 | Point bulletPosition = Point(planePosition.x, planePosition.y + static_cast(this->getParent())->getPlaneLayer()->getChildByName("PLANE")->getContentSize().height);
40 |
41 | bullet->setPosition(bulletPosition);
42 | bullet->setUserData(new BulletUserData(eachBulletDamage, nowBulletLevel));
43 | allBullet.pushBack(bullet);
44 | this->bulletBatchNodeVector[nowBulletLevel]->addChild(bullet);
45 |
46 | float bulletFlyLenth = Director::getInstance()->getWinSize().height - bulletPosition.y + (bullet->getContentSize().height / 2);
47 | float bulletFlySpeed = 1000 / 1;
48 | float bulletFltTime = bulletFlyLenth / bulletFlySpeed;
49 |
50 | FiniteTimeAction* bulletMove = MoveTo::create(bulletFltTime, Point(bulletPosition.x, Director::getInstance()->getWinSize().height + bullet->getContentSize().height / 2));
51 | FiniteTimeAction* bulletRemove = CallFuncN::create(CC_CALLBACK_1(BulletLayer::bulletMoveFinished, this));
52 |
53 | auto bulleAction = Sequence::create(bulletMove, bulletRemove, NULL);
54 | bullet->runAction(bulleAction);
55 | }
56 |
57 | void BulletLayer::bulletMoveFinished(Node* pSender) {
58 | Sprite* bullet = static_cast(pSender);
59 | BulletUserData* bulletUserData = static_cast(bullet->getUserData());
60 | int bulletLevel = bulletUserData->getBulletLevel();
61 | delete bulletUserData;
62 | allBullet.eraseObject(bullet);
63 | this->bulletBatchNodeVector[bulletLevel]->removeChild(bullet, true);
64 | }
65 |
66 | void BulletLayer::startShooting() {
67 | this->schedule(schedule_selector(BulletLayer::addBullet), UserDefault::getInstance()->getFloatForKey("intervalOfAddBullet"));
68 | }
69 |
70 | void BulletLayer::stopShooting() {
71 | this->unschedule(schedule_selector(BulletLayer::addBullet));
72 | }
73 |
74 | BulletLayer::BulletLayer() :
75 | eachBulletDamage(UserDefault::getInstance()->getIntegerForKey("damageOfInitBullet")), nowBulletLevel(0) {
76 | }
77 |
78 | BulletLayer::~BulletLayer() {
79 | }
80 |
81 | void BulletLayer::setBulletLevelUP() {
82 | if (nowBulletLevel < 2) {
83 | this->nowBulletLevel += 1;
84 | this->eachBulletDamage += UserDefault::getInstance()->getIntegerForKey("damageOfDeltaWhenLevelUp");
85 | }
86 | }
87 |
88 | void BulletLayer::launchBigBomb() {
89 | for(int i = 0; i < Director::getInstance()->getWinSize().width + Sprite::createWithSpriteFrameName("bigBomb.png")->getContentSize().width ; i += Sprite::createWithSpriteFrameName("bigBomb.png")->getContentSize().width){
90 | Sprite* bigBomb = Sprite::createWithSpriteFrameName("bigBomb.png");
91 | bigBomb->setPosition(i, - bigBomb->getContentSize().height /2);
92 | bigBomb->setUserData(new BulletUserData(UserDefault::getInstance()->getIntegerForKey("damageOfBigBomb"), 3));
93 | allBullet.pushBack(bigBomb);
94 | this->bulletBatchNodeVector[3]->addChild(bigBomb);
95 |
96 | float bulletFlyLenth = Director::getInstance()->getWinSize().height - bigBomb->getPositionY() + (bigBomb->getContentSize().height / 2);
97 | float bulletFlySpeed = 1000 / 1;
98 | float bulletFltTime = bulletFlyLenth / bulletFlySpeed;
99 |
100 | FiniteTimeAction* bulletMove = MoveTo::create(bulletFltTime, Point(bigBomb->getPositionX(), Director::getInstance()->getWinSize().height + bigBomb->getContentSize().height / 2));
101 | FiniteTimeAction* bulletRemove = CallFuncN::create(CC_CALLBACK_1(BulletLayer::bulletMoveFinished, this));
102 |
103 | auto bulleAction = Sequence::create(bulletMove, bulletRemove, NULL);
104 | bigBomb->runAction(bulleAction);
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/Classes/BulletLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * BulletLayer.h
3 | *
4 | * Created on: 2015年1月16日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef BULLETLAYER_H_
9 | #define BULLETLAYER_H_
10 |
11 | #include "cocos2d.h"
12 |
13 | class BulletLayer : public cocos2d::Layer{
14 | public:
15 | cocos2d::Vector allBullet;
16 |
17 | CREATE_FUNC(BulletLayer);
18 | void bulletMoveFinished(Node* pSender);
19 | void stopShooting();
20 | void setBulletLevelUP();
21 | void launchBigBomb();
22 |
23 | private:
24 | int eachBulletDamage;
25 | std::vector bulletTextureName;
26 | int nowBulletLevel;
27 | std::vector bulletBatchNodeVector;
28 |
29 | BulletLayer();
30 | ~BulletLayer();
31 | virtual bool init() override;
32 | void startShooting();
33 | void addBullet(float useless);
34 | };
35 |
36 | #endif /* BULLETLAYER_H_ */
37 |
--------------------------------------------------------------------------------
/Classes/BulletUserData.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * BulletUserData.cpp
3 | *
4 | * Created on: 2015年1月18日
5 | * Author: netbeen
6 | */
7 |
8 | #include "BulletUserData.h"
9 |
10 | BulletUserData::BulletUserData(int initDamage, int initBulletLevel):damage(initDamage),bulletLevel(initBulletLevel){
11 | }
12 |
13 | int BulletUserData::getDamage() const{
14 | return this->damage;
15 | }
16 |
17 | int BulletUserData::getBulletLevel() const{
18 | return this->bulletLevel;
19 | }
20 |
--------------------------------------------------------------------------------
/Classes/BulletUserData.h:
--------------------------------------------------------------------------------
1 | /*
2 | * BulletUserData.h
3 | *
4 | * Created on: 2015年1月18日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef BULLETUSERDATA_H_
9 | #define BULLETUSERDATA_H_
10 |
11 | class BulletUserData {
12 | public:
13 | BulletUserData(int initDamage, int initBulletLevel);
14 | int getDamage() const;
15 | int getBulletLevel() const;
16 | private:
17 | int damage;
18 | int bulletLevel;
19 | };
20 |
21 | #endif /* BULLETUSERDATA_H_ */
22 |
--------------------------------------------------------------------------------
/Classes/ControlLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * ControlLayer.cpp
3 | *
4 | * Created on: 2015年1月20日
5 | * Author: netbeen
6 | */
7 |
8 | #include "ControlLayer.h"
9 |
10 | #include "GameScene.h"
11 |
12 | USING_NS_CC;
13 |
14 | ControlLayer::ControlLayer() :
15 | score(0), scoreLabel(nullptr), pauseButtonItem(nullptr),HPIndicator(nullptr),launchButton(nullptr),launchButtonItem(nullptr),pauseButton(nullptr) {
16 | }
17 |
18 | void ControlLayer::addScoreBy(int addScore) {
19 | this->score += addScore;
20 | this->updateScore();
21 | return;
22 | }
23 |
24 | bool ControlLayer::init() {
25 | auto listenerkeyPad = EventListenerKeyboard::create();
26 | listenerkeyPad->onKeyReleased = CC_CALLBACK_2(ControlLayer::onKeyReleased, this);
27 | _eventDispatcher->addEventListenerWithSceneGraphPriority(listenerkeyPad, this);
28 |
29 | scoreLabel = Label::createWithTTF("0", "fonts/MarkerFelt.ttf", 60);
30 | scoreLabel->setAnchorPoint(Point(1.0f, 1.0f));
31 | scoreLabel->setPosition(Director::getInstance()->getWinSize().width - 50, Director::getInstance()->getWinSize().height - 50);
32 | this->addChild(scoreLabel);
33 |
34 | pauseButtonItem = MenuItemSprite::create(Sprite::createWithSpriteFrameName("pauseButton.png"), Sprite::createWithSpriteFrameName("pauseButton.png"),CC_CALLBACK_1(ControlLayer::menuPauseCallback, this));
35 | pauseButton = Menu::create(pauseButtonItem, nullptr);
36 | pauseButton->setAnchorPoint(Point(0.0f, 1.0f));
37 | pauseButton->setPosition(75, Director::getInstance()->getWinSize().height - 75);
38 | this->addChild(pauseButton);
39 |
40 | Sprite* HPBottomSprite = Sprite::createWithSpriteFrameName("HPBottom.png");
41 | HPBottomSprite->setPosition(100, 100);
42 | this->addChild(HPBottomSprite);
43 | Sprite* HP = Sprite::createWithSpriteFrameName("HP.png");
44 | HPIndicator = ProgressTimer::create(HP);
45 | HPIndicator->setType(ProgressTimer::Type::RADIAL);
46 | HPIndicator->setPercentage(100);
47 | HPIndicator->setPosition(100, 100);
48 | addChild(HPIndicator, 0, 0);
49 |
50 | launchButtonItem = MenuItemSprite::create(Sprite::createWithSpriteFrameName("launchButton.png"), Sprite::createWithSpriteFrameName("launchButton.png"), Sprite::createWithSpriteFrameName("launchButtonUnable.png"), CC_CALLBACK_1(ControlLayer::menuLaunchCallback, this));
51 | launchButton = Menu::create(launchButtonItem, nullptr);
52 | launchButton->setPosition(100, 100);
53 |
54 | launchButtonItem->setEnabled(false);
55 | launchButton->setEnabled(false);
56 |
57 | this->addChild(launchButton);
58 | return true;
59 | }
60 |
61 | void ControlLayer::updateHPIndicator(){
62 | int HP = static_cast(static_cast(this->getParent())->getPlaneLayer()->getMyPlane()->getUserData())->getHP();
63 | int initHP = static_cast(this->getParent())->getPlaneLayer()->getInitHP();
64 | float HPOld = HPIndicator->getPercentage();
65 | float HPPercentage = static_cast(HP) / static_cast(initHP);
66 | ProgressFromTo* animation = ProgressFromTo::create(0.2, HPOld, HPPercentage * 100);
67 | HPIndicator->runAction(animation);
68 | }
69 |
70 | void ControlLayer::updateScore() {
71 | std::string strScore;
72 | std::strstream ss;
73 | ss << this->score;
74 | ss >> strScore;
75 | scoreLabel->setString(strScore.c_str());
76 | if(this->score % 1000 == 0){
77 | static_cast(this->getParent())->getUFOLayer()->addGiftSprite();
78 | }
79 | }
80 |
81 | void ControlLayer::menuPauseCallback(Ref* pSender) {
82 | //如果游戏已在暂停中
83 | if (Director::getInstance()->isPaused()) {
84 | Director::getInstance()->resume();
85 | pauseButtonItem->setNormalImage(Sprite::createWithSpriteFrameName("pauseButton.png"));
86 | pauseButtonItem->setSelectedImage(Sprite::createWithSpriteFrameName("startButton.png"));
87 | } else {
88 | //如果游戏正在进行
89 | Director::getInstance()->pause();
90 | pauseButtonItem->setNormalImage(Sprite::createWithSpriteFrameName("startButton.png"));
91 | pauseButtonItem->setSelectedImage(Sprite::createWithSpriteFrameName("pauseButton.png"));
92 | }
93 | }
94 |
95 | void ControlLayer::menuLaunchCallback(Ref* pSender){
96 | launchButtonItem->setEnabled(false);
97 | launchButton->setEnabled(false);
98 | static_cast(this->getParent())->getBulletLayer()->launchBigBomb();
99 | }
100 |
101 | void ControlLayer::setLaunchButtonEnable(){
102 | launchButtonItem->setEnabled(true);
103 | launchButton->setEnabled(true);
104 | }
105 |
106 | void ControlLayer::onKeyReleased(EventKeyboard::KeyCode keycode, Event* event){
107 | switch (keycode) {
108 | case EventKeyboard::KeyCode::KEY_BACK:
109 | Director::getInstance()->end();
110 | break;
111 | default:
112 | break;
113 | }
114 | }
115 |
116 | int ControlLayer::getScore(){
117 | return this->score;
118 | }
119 |
--------------------------------------------------------------------------------
/Classes/ControlLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ControlLayer.h
3 | *
4 | * Created on: 2015年1月20日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef CONTROLLAYER_H_
9 | #define CONTROLLAYER_H_
10 |
11 | #include
12 | #include "cocos2d.h"
13 | #include "GameBackgroundLayer.h"
14 | #include "PlaneLayer.h"
15 | #include "PlaneUserData.h"
16 | #include "UFOLayer.h"
17 |
18 |
19 | class ControlLayer : public cocos2d::Layer{
20 | public:
21 | CREATE_FUNC(ControlLayer);
22 | void addScoreBy(int addScore);
23 | void updateHPIndicator();
24 | void setLaunchButtonEnable();
25 | int getScore();
26 | private:
27 | int score;
28 | cocos2d::Label* scoreLabel;
29 | cocos2d::MenuItemSprite* pauseButtonItem;
30 | cocos2d::MenuItemSprite* launchButtonItem;
31 | cocos2d::ProgressTimer* HPIndicator;
32 | cocos2d::Menu* pauseButton;
33 | cocos2d::Menu* launchButton;
34 |
35 | void updateScore();
36 | void menuPauseCallback(cocos2d::Ref* pSender);
37 | ControlLayer();
38 | virtual bool init() override;
39 | void menuLaunchCallback(cocos2d::Ref* pSender);
40 | virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keycode, cocos2d::Event* event) override;//对应back键
41 | };
42 |
43 | #endif /* CONTROLLAYER_H_ */
44 |
--------------------------------------------------------------------------------
/Classes/EnemyBulletLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * EnemyBulletLayer.cpp
3 | *
4 | * Created on: 2015年1月29日
5 | * Author: netbeen
6 | */
7 |
8 | #include "EnemyBulletLayer.h"
9 | #include "GameScene.h"
10 | #include "ResultScene.h"
11 |
12 | USING_NS_CC;
13 |
14 | void EnemyBulletLayer::bossStartShooting() {
15 | this->schedule(schedule_selector(EnemyBulletLayer::addBossBulletSet), UserDefault::getInstance()->getFloatForKey("intervalOfAddEnemyBullet"));
16 | this->scheduleUpdate();
17 | }
18 |
19 | void EnemyBulletLayer::bossStopShooting() {
20 | this->unschedule(schedule_selector(EnemyBulletLayer::addBossBulletSet));
21 | this->unscheduleUpdate();
22 | }
23 |
24 | bool EnemyBulletLayer::init(){
25 | return true;
26 | }
27 |
28 | EnemyBulletLayer::EnemyBulletLayer() :actionExplosion(nullptr){
29 | winSize = Director::getInstance()->getWinSize();
30 | }
31 |
32 | void EnemyBulletLayer::addBossBulletSet(float useless) {
33 | Sprite* bulletSet = Sprite::createWithSpriteFrameName("enemyBulletSet.png");
34 |
35 | Point bossPosition = static_cast(this->getParent())->getEnemyLayer()->getBossSprite()->getPosition();
36 | bulletSet->setPosition(bossPosition);
37 | allEnemyBullet.pushBack(bulletSet);
38 | this->addChild(bulletSet);
39 |
40 | FiniteTimeAction* bulletSetMove = MoveTo::create(2, Point(-winSize.width/2 + CCRANDOM_0_1()*winSize.width*2, -bulletSet->getContentSize().height/2));
41 | FiniteTimeAction* bulletSetRemove = CallFuncN::create(CC_CALLBACK_1(EnemyBulletLayer::bossBulletMoveFinished, this));
42 | Sequence* bulletSetSequence = Sequence::create(bulletSetMove, bulletSetRemove, NULL);
43 | bulletSet->runAction(bulletSetSequence);
44 | }
45 |
46 | void EnemyBulletLayer::bossBulletMoveFinished(Node* pSender) {
47 | Sprite* bullet = static_cast(pSender);
48 | this->allEnemyBullet.eraseObject(bullet);
49 | this->removeChild(bullet);
50 | }
51 |
52 | void EnemyBulletLayer::update(float useless) {
53 | Animation* animationExplosion = AnimationCache::getInstance()->getAnimation("explosion");
54 | animationExplosion->setRestoreOriginalFrame(false);
55 | animationExplosion->setDelayPerUnit(0.5f / 9.0f);
56 | actionExplosion = Animate::create(animationExplosion);
57 |
58 | Sprite* myPlane = static_cast(this->getParent())->getPlaneLayer()->getMyPlane();
59 | for (Sprite* bullet : this->allEnemyBullet) {
60 | if (bullet->getBoundingBox().intersectsRect(myPlane->getBoundingBox())) {
61 |
62 | if(static_cast(myPlane->getUserData())->isAliveUnderAttack(200) == false){
63 | //更新HP指示器
64 | static_cast(this->getParent())->getControlLayer()->updateHPIndicator();
65 | static_cast(this->getParent())->getBulletLayer()->stopShooting();
66 | myPlane->runAction(Sequence::create(actionExplosion, NULL));
67 | scheduleOnce(schedule_selector(EnemyBulletLayer::changeSceneCallBack), 1.0f);
68 | this->bossStopShooting();
69 | return;
70 | }else{
71 | //更新HP指示器
72 | static_cast(this->getParent())->getControlLayer()->updateHPIndicator();
73 | }
74 | bossBulletMoveFinished(bullet);
75 | }
76 | }
77 | }
78 |
79 | void EnemyBulletLayer::changeSceneCallBack(float useless) {
80 | Scene* resultSceneWithAnimation = TransitionFade::create(2.0f, ResultScene::create(false, static_cast(this->getParent())->getControlLayer()->getScore()));
81 | Director::getInstance()->replaceScene(resultSceneWithAnimation);
82 | }
83 |
--------------------------------------------------------------------------------
/Classes/EnemyBulletLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * EnemyBulletLayer.h
3 | *
4 | * Created on: 2015年1月29日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef ENEMYBULLETLAYER_H_
9 | #define ENEMYBULLETLAYER_H_
10 |
11 | #include "cocos2d.h"
12 |
13 |
14 |
15 | class EnemyBulletLayer : public cocos2d::Layer{
16 | public:
17 | CREATE_FUNC(EnemyBulletLayer);
18 | void bossStartShooting();
19 | void bossStopShooting();
20 | virtual bool init() override;
21 | private:
22 | cocos2d::Vector allEnemyBullet;
23 | cocos2d::Size winSize;
24 | cocos2d::Animate* actionExplosion;
25 |
26 | EnemyBulletLayer();
27 | void addBossBulletSet(float useless);
28 | void bossBulletMoveFinished(Node* pSender);
29 | void update(float useless);
30 | void changeSceneCallBack(float useless);
31 | };
32 |
33 | #endif /* ENEMYBULLETLAYER_H_ */
34 |
--------------------------------------------------------------------------------
/Classes/EnemyLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * EnemyLayer.cpp
3 | *
4 | * Created on: 2015年1月17日
5 | * Author: netbeen
6 | */
7 |
8 | #include "EnemyLayer.h"
9 |
10 | #include "PlaneLayer.h"
11 | #include "EnemyUserData.h"
12 | #include "BulletLayer.h"
13 | #include "BulletUserData.h"
14 | #include "PlaneLayer.h"
15 | #include "PlaneUserData.h"
16 | #include "ControlLayer.h"
17 | #include "ResultScene.h"
18 | #include "GameScene.h"
19 |
20 | USING_NS_CC;
21 |
22 | EnemyLayer::EnemyLayer() :
23 | winSize(Director::getInstance()->getWinSize()),bossWarning(nullptr),bossSprite(nullptr), baseEnemyAppearProbability(UserDefault::getInstance()->getFloatForKey("probabilityOfBaseEnemyAppear")), deltaEnemyAppearProbability(UserDefault::getInstance()->getFloatForKey("probabilityOfDeltaEnemyAppear")), nowEnemyAppearProbability(baseEnemyAppearProbability), bossAppeared(false) {
24 | }
25 |
26 | EnemyLayer::~EnemyLayer() {
27 | }
28 |
29 | bool EnemyLayer::init() {
30 | std::string name1 = "enemy1.png";
31 | std::string name2 = "enemy2.png";
32 | std::string name3 = "enemy3.png";
33 | enemyTextureName.push_back(name1);
34 | enemyTextureName.push_back(name2);
35 | enemyTextureName.push_back(name3);
36 |
37 | enemyFlyTime.push_back(UserDefault::getInstance()->getIntegerForKey("FlytimeOfEnemy1"));
38 | enemyFlyTime.push_back(UserDefault::getInstance()->getIntegerForKey("FlytimeOfEnemy2"));
39 | enemyFlyTime.push_back(UserDefault::getInstance()->getIntegerForKey("FlytimeOfEnemy3"));
40 | enemyInitHP.push_back(UserDefault::getInstance()->getIntegerForKey("HPOfEnemy1"));
41 | enemyInitHP.push_back(UserDefault::getInstance()->getIntegerForKey("HPOfEnemy2"));
42 | enemyInitHP.push_back(UserDefault::getInstance()->getIntegerForKey("HPOfEnemy3"));
43 | startAddEnemy();
44 | this->scheduleUpdate();
45 |
46 | bossWarning = Sprite::createWithSpriteFrameName("bossWarning.png");
47 | bossWarning->setPosition(Director::getInstance()->getWinSize().width / 2, Director::getInstance()->getWinSize().height / 2);
48 | bossWarning->setScale(3.0f);
49 | bossWarning->setOpacity(0);
50 | this->addChild(bossWarning, 128);
51 |
52 | return true;
53 | }
54 |
55 | void EnemyLayer::addEnemySprite(float useless) {
56 | float testProbability = CCRANDOM_0_1();
57 | if(testProbability < nowEnemyAppearProbability) {
58 | int randomLevel = CCRANDOM_0_1() * 3;
59 | Sprite* enemySprite = Sprite::createWithSpriteFrameName(enemyTextureName[randomLevel].c_str());
60 | int randomX = CCRANDOM_0_1()*winSize.width;
61 | enemySprite->setPosition(randomX, winSize.height +enemySprite->getContentSize().height/2 );
62 | enemySprite->setUserData(new EnemyUserData(enemyInitHP[randomLevel]));
63 | this->addChild(enemySprite);
64 | allEnemy.pushBack(enemySprite);
65 |
66 | FiniteTimeAction* enemyMove = MoveTo::create(enemyFlyTime[randomLevel], Point(randomX, - enemySprite->getContentSize().height/2));
67 | FiniteTimeAction* enemyRemove = CallFuncN::create(CC_CALLBACK_1(EnemyLayer::enemyMoveFinished, this));
68 | Action* enemyAction = Sequence::create(enemyMove, enemyRemove, NULL);
69 | enemySprite->runAction(enemyAction);
70 | }
71 | nowEnemyAppearProbability += deltaEnemyAppearProbability;
72 | if(nowEnemyAppearProbability > 1) {
73 | this->stopAddEnemy();
74 | this->setBossWarningOn();
75 | this->addBossSprite();
76 | }
77 | }
78 |
79 | void EnemyLayer::enemyMoveFinished(Node* pSender) {
80 | Sprite* enemy = (Sprite*) pSender;
81 | allEnemy.eraseObject(enemy);
82 | delete static_cast(enemy->getUserData());
83 | this->removeChild(enemy, true);
84 | }
85 |
86 | void EnemyLayer::startAddEnemy() {
87 | this->schedule(schedule_selector(EnemyLayer::addEnemySprite), UserDefault::getInstance()->getFloatForKey("intervalOfAddEnemy"));
88 | }
89 |
90 | void EnemyLayer::stopAddEnemy() {
91 | this->unschedule(schedule_selector(EnemyLayer::addEnemySprite));
92 | }
93 |
94 | // 通关检测、碰撞检测
95 | void EnemyLayer::update(float useless) {
96 | Animation* animationExplosion = AnimationCache::getInstance()->getAnimation("explosion");
97 | animationExplosion->setRestoreOriginalFrame(false);
98 | animationExplosion->setDelayPerUnit(0.5f / 9.0f);
99 | auto actionExplosion = Animate::create(animationExplosion);
100 |
101 | //判断是否已经通关
102 | if ((allEnemy.empty() == true) && (this->bossAppeared == true)) {
103 | static_cast(this->getParent())->getEnemyBulletLayer()->bossStopShooting();
104 | scheduleOnce(schedule_selector(EnemyLayer::changeSceneCallBack), 1.0f);
105 | }
106 |
107 | //遍历敌机
108 | for (Sprite* enemy : this->allEnemy) {
109 | //判断敌机是否正在爆炸
110 | if (static_cast(enemy->getUserData())->getIsDeleting() == false) {
111 | for (Sprite* bullet : static_cast(this->getParent())->getBulletLayer()->allBullet) {
112 | FiniteTimeAction* enemyRemove = CallFuncN::create(CC_CALLBACK_1(EnemyLayer::enemyMoveFinished, this));
113 | //判断子弹是否与敌机碰撞,之所以要重复判断是否isDeleting是为了防止两个弹头同时命中目标会造成程序崩溃的bug
114 | if (bullet->getBoundingBox().intersectsRect(enemy->getBoundingBox()) && (static_cast(enemy->getUserData())->getIsDeleting() == false)) {
115 |
116 | //读取子弹的伤害,给敌机造成伤害
117 | if (static_cast(enemy->getUserData())->isAliveUnderAttack(static_cast(bullet->getUserData())->getDamage()) == false) {
118 | enemy->stopAllActions();
119 | static_cast(enemy->getUserData())->setIsDeleting();
120 | enemy->runAction(Sequence::create(actionExplosion, enemyRemove, NULL));
121 | //摧毁敌机后加分
122 | static_cast(this->getParent())->getControlLayer()->addScoreBy(100);
123 | }
124 | //end读取子弹的伤害,给敌机造成伤害
125 |
126 | //根据损血改变BOSS外观
127 | if(this->bossAppeared == true){
128 | if(static_cast(bossSprite->getUserData())->getHP() < (UserDefault::getInstance()->getIntegerForKey("HPOfEnemyBoss") /3*2) && (static_cast(bossSprite->getUserData())->getHP() > (UserDefault::getInstance()->getIntegerForKey("HPOfEnemyBoss") /3))){
129 | bossSprite->setSpriteFrame("enemyBossBroken.png");
130 | }else if(static_cast(bossSprite->getUserData())->getHP() < (UserDefault::getInstance()->getIntegerForKey("HPOfEnemyBoss") /3)){
131 | bossSprite->setSpriteFrame("enemyBossBrokenMore.png");
132 | }
133 | }//end根据损血改变BOSS外观
134 |
135 | //回收子弹
136 | static_cast(this->getParent())->getBulletLayer()->bulletMoveFinished(bullet);
137 | }
138 | //end判断子弹是否与敌机碰撞
139 |
140 | //判断我方飞机是否与敌机碰撞
141 | if (enemy->getBoundingBox().intersectsRect(static_cast(this->getParent())->getPlaneLayer()->getMyPlane()->getBoundingBox()) && static_cast(static_cast(this->getParent())->getPlaneLayer()->getMyPlane()->getUserData())->getHP() > 0) {
142 | //给敌机造成碰撞伤害
143 | if (static_cast(enemy->getUserData())->isAliveUnderAttack(400) == false) {
144 | enemy->stopAllActions();
145 | static_cast(enemy->getUserData())->setIsDeleting();
146 | enemy->runAction(Sequence::create(actionExplosion, enemyRemove, NULL));
147 |
148 | //撞毁敌机后加分
149 | static_cast(this->getParent())->getControlLayer()->addScoreBy(100);
150 | }
151 | //end给敌机造成碰撞伤害
152 |
153 | //给我方飞机造成碰撞伤害
154 | if (static_cast(static_cast(this->getParent())->getPlaneLayer()->getMyPlane()->getUserData())->isAliveUnderAttack(200) == false) {
155 | static_cast(this->getParent())->getBulletLayer()->stopShooting();
156 | static_cast(this->getParent())->getPlaneLayer()->getMyPlane()->runAction(Sequence::create(actionExplosion, NULL));
157 | scheduleOnce(schedule_selector(EnemyLayer::changeSceneCallBack), 1.0f);
158 | }
159 | //end给我方飞机造成碰撞伤害
160 |
161 | //更新HP指示器
162 | static_cast(this->getParent())->getControlLayer()->updateHPIndicator();
163 | }
164 | //end判断我方飞机是否与敌机碰撞
165 | }
166 | }
167 | //end判断敌机是否正在爆炸
168 | }
169 | //end遍历敌机
170 | }
171 |
172 | void EnemyLayer::addBossSprite() {
173 | bossSprite = Sprite::createWithSpriteFrameName("enemyBoss.png");
174 | bossSprite->setPosition(winSize.width / 2, winSize.height + bossSprite->getContentSize().height);
175 | bossSprite->setUserData(new EnemyUserData(UserDefault::getInstance()->getIntegerForKey("HPOfEnemyBoss")));
176 | this->addChild(bossSprite);
177 | allEnemy.pushBack(bossSprite);
178 |
179 | FiniteTimeAction* bossAppear = MoveTo::create(UserDefault::getInstance()->getIntegerForKey("FlytimeOfEnemyBossAppear"), Point(winSize.width / 2, winSize.height - 200 - bossSprite->getContentSize().height / 2));
180 | FiniteTimeAction* bossAppearDone = CallFuncN::create(CC_CALLBACK_0(EnemyLayer::bossStartMove, this));
181 |
182 | Action* enemyAppearAction = Sequence::create(bossAppear, bossAppearDone, NULL);
183 | bossSprite->runAction(enemyAppearAction);
184 |
185 | this->bossAppeared = true;
186 | }
187 |
188 | // 通关 / 阵亡后,调用该函数进行场景切换
189 | void EnemyLayer::changeSceneCallBack(float useless) {
190 | Scene* resultSceneWithAnimation;
191 | if((allEnemy.empty() == true) && (this->bossAppeared == true)){
192 | resultSceneWithAnimation = TransitionFade::create(2.0f, ResultScene::create(true, static_cast(this->getParent())->getControlLayer()->getScore()));
193 | }else{
194 | resultSceneWithAnimation = TransitionFade::create(2.0f, ResultScene::create(false, static_cast(this->getParent())->getControlLayer()->getScore()));
195 | }
196 | Director::getInstance()->replaceScene(resultSceneWithAnimation);
197 | }
198 |
199 | void EnemyLayer::setBossWarningOn() {
200 | Sequence* sequenceFront = Sequence::create(FadeIn::create(0.5f), FadeOut::create(1.5f), FadeIn::create(0.5f), FadeOut::create(2.0f), NULL);
201 | this->bossWarning->runAction(sequenceFront);
202 | }
203 |
204 | void EnemyLayer::bossStartMove() {
205 | Vector bossMoveBezier;
206 | for (int i = 0; i < 10; i++) {
207 | ccBezierConfig bezierConfig;
208 | bezierConfig.controlPoint_1 = Point(CCRANDOM_0_1()*winSize.width,CCRANDOM_0_1()*winSize.height);
209 | bezierConfig.controlPoint_2 = Point(CCRANDOM_0_1()*winSize.width,CCRANDOM_0_1()*winSize.height);
210 | bezierConfig.endPosition = Point(CCRANDOM_0_1()*winSize.width,winSize.height/3*2 + (CCRANDOM_0_1()*winSize.height /3 ));
211 | FiniteTimeAction* tempBossMoveBezier = BezierTo::create(3.0f, bezierConfig);
212 | bossMoveBezier.pushBack(tempBossMoveBezier);
213 | }
214 | Sequence* bossMoveSequence = Sequence::create(bossMoveBezier.at(0),bossMoveBezier.at(1),bossMoveBezier.at(2),bossMoveBezier.at(3),bossMoveBezier.at(4),bossMoveBezier.at(5),bossMoveBezier.at(6),bossMoveBezier.at(7),bossMoveBezier.at(8),bossMoveBezier.at(9),NULL);
215 | RepeatForever* bossMoveSequenceRepeat = RepeatForever::create(bossMoveSequence);
216 | bossSprite->runAction(bossMoveSequenceRepeat);
217 |
218 | static_cast(this->getParent())->getEnemyBulletLayer()->bossStartShooting();
219 | }
220 |
221 | Sprite* EnemyLayer::getBossSprite(){
222 | return this->bossSprite;
223 | }
224 |
--------------------------------------------------------------------------------
/Classes/EnemyLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * EnemyLayer.h
3 | *
4 | * Created on: 2015年1月17日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef ENEMYLAYER_H_
9 | #define ENEMYLAYER_H_
10 |
11 | #include
12 | #include
13 | #include "cocos2d.h"
14 |
15 |
16 |
17 | class EnemyLayer : public cocos2d::Layer{
18 | public:
19 | CREATE_FUNC(EnemyLayer);
20 | cocos2d::Sprite* getBossSprite();
21 | private:
22 | const float baseEnemyAppearProbability;
23 | const float deltaEnemyAppearProbability;
24 | float nowEnemyAppearProbability;
25 | std::vector enemyTextureName;
26 | std::vector enemyFlyTime;
27 | std::vector enemyInitHP;
28 | cocos2d::Vector allEnemy;
29 | const cocos2d::Size winSize;
30 | bool bossAppeared;
31 | cocos2d::Sprite* bossWarning;
32 | cocos2d::Sprite* bossSprite;
33 |
34 |
35 | EnemyLayer();
36 | ~EnemyLayer();
37 | virtual bool init() override;
38 | void addEnemySprite(float useless);
39 | void enemyMoveFinished(Node* pSender);
40 | void startAddEnemy();
41 | void stopAddEnemy();
42 | void update(float useless) override;
43 | void addBossSprite();
44 | void changeSceneCallBack(float useless);
45 | void setBossWarningOn();
46 | void bossStartMove();
47 |
48 | };
49 |
50 | #endif /* ENEMYLAYER_H_ */
51 |
--------------------------------------------------------------------------------
/Classes/EnemyUserData.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * EnemyUserData.cpp
3 | *
4 | * Created on: 2015年1月18日
5 | * Author: netbeen
6 | */
7 |
8 | #include "EnemyUserData.h"
9 |
10 | EnemyUserData::EnemyUserData(int initHP):isDeleting(false),HP(initHP){
11 | }
12 |
13 | void EnemyUserData::setIsDeleting(){
14 | this->isDeleting = true;
15 | }
16 |
17 | bool EnemyUserData::getIsDeleting() const{
18 | return this->isDeleting;
19 | }
20 |
21 | bool EnemyUserData::isAliveUnderAttack(int damage){
22 | this->HP -= damage;
23 | if(this->HP <= 0){
24 | return false;
25 | }else{
26 | return true;
27 | }
28 | }
29 |
30 | int EnemyUserData::getHP(){
31 | return this->HP;
32 | }
33 |
--------------------------------------------------------------------------------
/Classes/EnemyUserData.h:
--------------------------------------------------------------------------------
1 | /*
2 | * EnemyUserData.h
3 | *
4 | * Created on: 2015年1月18日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef ENEMYUSERDATA_H_
9 | #define ENEMYUSERDATA_H_
10 |
11 | class EnemyUserData {
12 | public:
13 | EnemyUserData(int initHP);
14 | void setIsDeleting();
15 | bool getIsDeleting() const;
16 | bool isAliveUnderAttack(int damage);
17 | int getHP();
18 | private:
19 | int HP;
20 | bool isDeleting;
21 | };
22 |
23 | #endif /* ENEMYUSERDATA_H_ */
24 |
--------------------------------------------------------------------------------
/Classes/GameBackgroundLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * GameBackgroundLayer.cpp
3 | *
4 | * Created on: 2015年1月15日
5 | * Author: netbeen
6 | */
7 |
8 | #include "GameBackgroundLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | const float backgroundMoveSpeed = 1;
13 |
14 | bool GameBackgroundLayer::init(){
15 | background1 = Sprite::createWithSpriteFrameName("img_bg_1.jpg");
16 | background1->setAnchorPoint(Point(0,0));
17 | background1->setScale(2);
18 | this->addChild(background1);
19 |
20 | background2 = Sprite::createWithSpriteFrameName("img_bg_1.jpg");
21 | background2->setAnchorPoint(Point(0,0));
22 | background2->setScale(2);
23 | this->addChild(background2);
24 |
25 | winSize = Director::getInstance()->getWinSize();
26 |
27 | scheduleUpdate();
28 | //this->schedule(schedule_selector(GameBackgroundLayer::addCloud), UserDefault::getInstance()->getFloatForKey("intervalOfAddCloud"));
29 | //this->addCloud(0.5);
30 | return true;
31 | }
32 |
33 | void GameBackgroundLayer::update(float useless){
34 | background1->setPositionY(background1->getPositionY() - backgroundMoveSpeed);
35 | background2->setPositionY(background1->getPositionY() + background1->getContentSize().height*2 - 1);
36 | if(background2->getPositionY() < 0){
37 | background1->setPositionY(0);
38 | }
39 | }
40 |
41 | /*void GameBackgroundLayer::addCloud(float useless){
42 | Sprite* cloud;
43 | if(CCRANDOM_0_1() < 0.5){
44 | cloud = Sprite::createWithSpriteFrameName("cloud1.png");
45 | }else{
46 | cloud = Sprite::createWithSpriteFrameName("cloud2.png");
47 | }
48 | int randomX = CCRANDOM_0_1()*winSize.width;
49 | cloud->setPosition(randomX, winSize.height + cloud->getContentSize().height/2);
50 | this->addChild(cloud);
51 |
52 | FiniteTimeAction* cloudMove = MoveTo::create(UserDefault::getInstance()->getIntegerForKey("FlytimeOfCloud"), Point(randomX, - cloud->getContentSize().height/2));
53 | FiniteTimeAction* cloudRemove = CallFuncN::create(CC_CALLBACK_1(GameBackgroundLayer::cloudMoveFinished, this));
54 | Action* cloudAction = Sequence::create(cloudMove, cloudRemove, NULL);
55 | cloud->runAction(cloudAction);
56 | }*/
57 |
58 | /*void GameBackgroundLayer::cloudMoveFinished(Node* pSender) {
59 | Sprite* cloud = (Sprite*) pSender;
60 | this->removeChild(cloud, true);
61 | }*/
62 |
--------------------------------------------------------------------------------
/Classes/GameBackgroundLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * GameBackgroundLayer.h
3 | *
4 | * Created on: 2015年1月15日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef GAMEBACKGROUNDLAYER_H_
9 | #define GAMEBACKGROUNDLAYER_H_
10 |
11 | #include "cocos2d.h"
12 |
13 | class GameBackgroundLayer : public cocos2d::Layer{
14 | public:
15 | CREATE_FUNC(GameBackgroundLayer);
16 | //void addCloud(float useless);
17 |
18 | private:
19 | void update(float useless) override;
20 | cocos2d::Sprite* background1;
21 | cocos2d::Sprite* background2;
22 | cocos2d::Size winSize;
23 |
24 | virtual bool init();
25 | //void cloudMoveFinished(Node* pSender);
26 | };
27 |
28 | #endif /* GAMEBACKGROUNDLAYER_H_ */
29 |
--------------------------------------------------------------------------------
/Classes/GameScene.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * GameScene.cpp
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #include "GameScene.h"
9 |
10 | #include
11 |
12 | USING_NS_CC;
13 |
14 | Scene* GameScene::gameScene = nullptr;
15 | GameBackgroundLayer* GameScene::gameBackgroundLayer = nullptr;
16 | UFOLayer* GameScene::ufoLayer = nullptr;
17 | BulletLayer* GameScene::bulletLayer = nullptr;
18 | EnemyLayer* GameScene::enemyLayer = nullptr;
19 | PlaneLayer* GameScene::planeLayer = nullptr;
20 | ControlLayer* GameScene::controlLayer = nullptr;
21 | EnemyBulletLayer* GameScene::enemyBulletLayer = nullptr;
22 |
23 | Scene* GameScene::create() {
24 | gameScene = Scene::create();
25 |
26 | gameBackgroundLayer = GameBackgroundLayer::create();
27 | gameBackgroundLayer->setParent(gameScene);
28 | planeLayer = PlaneLayer::create();
29 | planeLayer->setParent(gameScene);
30 | ufoLayer = UFOLayer::create();
31 | ufoLayer->setParent(gameScene);
32 | bulletLayer = BulletLayer::create();
33 | bulletLayer->setParent(gameScene);
34 | enemyLayer = EnemyLayer::create();
35 | enemyLayer->setParent(gameScene);
36 | controlLayer = ControlLayer::create();
37 | controlLayer->setParent(gameScene);
38 | enemyBulletLayer = EnemyBulletLayer::create();
39 | enemyBulletLayer->setParent(gameScene);
40 |
41 |
42 | gameScene->addChild(gameBackgroundLayer);
43 | gameScene->addChild(bulletLayer);
44 | gameScene->addChild(enemyBulletLayer);
45 | gameScene->addChild(enemyLayer);
46 | gameScene->addChild(planeLayer);
47 | gameScene->addChild(ufoLayer);
48 | gameScene->addChild(controlLayer);
49 |
50 | return gameScene;
51 | }
52 |
53 | PlaneLayer* GameScene::getPlaneLayer(){
54 | return this->planeLayer;
55 | }
56 |
57 | GameBackgroundLayer* GameScene::getGameBackgroundLayer(){
58 | return this->gameBackgroundLayer;
59 | }
60 |
61 | UFOLayer* GameScene::getUFOLayer(){
62 | return this->ufoLayer;
63 | }
64 | BulletLayer* GameScene::getBulletLayer(){
65 | return this->bulletLayer;
66 | }
67 | EnemyLayer* GameScene::getEnemyLayer(){
68 | return this->enemyLayer;
69 | }
70 | ControlLayer* GameScene::getControlLayer(){
71 | return this->controlLayer;
72 | }
73 |
74 | EnemyBulletLayer* GameScene::getEnemyBulletLayer(){
75 | return this->enemyBulletLayer;
76 | }
77 |
--------------------------------------------------------------------------------
/Classes/GameScene.h:
--------------------------------------------------------------------------------
1 | /*
2 | * GameScene.h
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef GAMESCENE_H_
9 | #define GAMESCENE_H_
10 |
11 | #include "cocos2d.h"
12 | #include "GameBackgroundLayer.h"
13 | #include "PlaneLayer.h"
14 | #include "BulletLayer.h"
15 | #include "EnemyLayer.h"
16 | #include "ControlLayer.h"
17 | #include "UFOLayer.h"
18 | #include "EnemyBulletLayer.h"
19 |
20 | class GameScene: public cocos2d::Scene {
21 | public:
22 | static cocos2d::Scene* create();
23 | GameBackgroundLayer* getGameBackgroundLayer();
24 | UFOLayer* getUFOLayer();
25 | BulletLayer* getBulletLayer();
26 | EnemyLayer* getEnemyLayer();
27 | ControlLayer* getControlLayer();
28 | PlaneLayer* getPlaneLayer();
29 | EnemyBulletLayer* getEnemyBulletLayer();
30 | private:
31 | static cocos2d::Scene* gameScene;
32 | static GameBackgroundLayer* gameBackgroundLayer;
33 | static UFOLayer* ufoLayer;
34 | static BulletLayer* bulletLayer;
35 | static EnemyLayer* enemyLayer;
36 | static PlaneLayer* planeLayer;
37 | static ControlLayer* controlLayer;
38 | static EnemyBulletLayer* enemyBulletLayer;
39 |
40 | };
41 |
42 | #endif /* GAMESCENE_H_ */
43 |
--------------------------------------------------------------------------------
/Classes/PlaneLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * PlaneLayer.cpp
3 | *
4 | * Created on: 2015年1月16日
5 | * Author: netbeen
6 | */
7 |
8 | #include "PlaneLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | bool PlaneLayer::init() {
13 | auto listener = EventListenerTouchOneByOne::create();
14 | listener->onTouchBegan = CC_CALLBACK_2(PlaneLayer::onTouchBegan, this);
15 | listener->onTouchMoved = CC_CALLBACK_2(PlaneLayer::onTouchMoved, this);
16 | _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
17 |
18 | myPlane = Sprite::createWithSpriteFrameName("myPlane.png");
19 | myPlane->setAnchorPoint(Point(0.5, 0));
20 | myPlane->setPosition(winSize.width / 2, 0);
21 | myPlane->setUserData(new PlaneUserData(initHP));
22 | this->addChild(myPlane, 0, "PLANE");
23 | return true;
24 | }
25 |
26 | PlaneLayer::PlaneLayer() :
27 | initHP(1000), myPlane(nullptr), winSize(Director::getInstance()->getWinSize()) {
28 | }
29 |
30 | bool PlaneLayer::onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *unused_event) {
31 | return true;
32 | }
33 |
34 | int PlaneLayer::getInitHP() const{
35 | return this->initHP;
36 | }
37 |
38 | void PlaneLayer::onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *unused_event) {
39 | if (Director::getInstance()->isPaused() == false) {
40 | myPlane->setPosition(myPlane->getPosition() + touch->getDelta());
41 | if (myPlane->getPositionX() < 0) {
42 | myPlane->setPositionX(0);
43 | } else if (myPlane->getPositionX() > winSize.width) {
44 | myPlane->setPositionX(winSize.width);
45 | }
46 | if (myPlane->getPositionY() < 0) {
47 | myPlane->setPositionY(0);
48 | } else if (myPlane->getPositionY() + myPlane->getContentSize().height > winSize.height) {
49 | myPlane->setPositionY(winSize.height - myPlane->getContentSize().height);
50 | }
51 | }
52 |
53 | }
54 |
55 | Sprite* PlaneLayer::getMyPlane() {
56 | return this->myPlane;
57 | }
58 |
--------------------------------------------------------------------------------
/Classes/PlaneLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PlaneLayer.h
3 | *
4 | * Created on: 2015年1月16日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef PLANELAYER_H_
9 | #define PLANELAYER_H_
10 |
11 | #include "cocos2d.h"
12 | #include "PlaneUserData.h"
13 |
14 | class PlaneLayer : public cocos2d::Layer{
15 | public:
16 | CREATE_FUNC(PlaneLayer);
17 | cocos2d::Sprite* getMyPlane();
18 | int getInitHP() const;
19 |
20 | private:
21 | const int initHP;
22 | PlaneLayer();
23 | const cocos2d::Size winSize;
24 | virtual bool init() override;
25 | virtual bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *unused_event) override;
26 | virtual void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *unused_event) override;
27 | cocos2d::Sprite* myPlane;
28 | };
29 |
30 | #endif /* PLANELAYER_H_ */
31 |
--------------------------------------------------------------------------------
/Classes/PlaneUserData.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * PlaneUserData.cpp
3 | *
4 | * Created on: 2015年1月19日
5 | * Author: netbeen
6 | */
7 |
8 | #include "PlaneUserData.h"
9 |
10 | #include "cocos2d.h"
11 | PlaneUserData::PlaneUserData(int initHP):HP(initHP){
12 | }
13 |
14 | bool PlaneUserData::isAliveUnderAttack(int damage){
15 | this->HP -= damage;
16 | if(this->HP <= 0){
17 | return false;
18 | }else{
19 | return true;
20 | }
21 | }
22 |
23 | int PlaneUserData::getHP() const{
24 | return this->HP;
25 | }
26 |
--------------------------------------------------------------------------------
/Classes/PlaneUserData.h:
--------------------------------------------------------------------------------
1 | /*
2 | * PlaneUserData.h
3 | *
4 | * Created on: 2015年1月19日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef PLANEUSERDATA_H_
9 | #define PLANEUSERDATA_H_
10 |
11 | class PlaneUserData {
12 | public:
13 | PlaneUserData(int initHP);
14 | bool isAliveUnderAttack(int damage);
15 | int getHP() const;
16 | private:
17 | int HP;
18 | };
19 |
20 | #endif /* PLANEUSERDATA_H_ */
21 |
--------------------------------------------------------------------------------
/Classes/ResultBackgroundLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * ResultBackgroundLayer.cpp
3 | *
4 | * Created on: 2015年1月27日
5 | * Author: netbeen
6 | */
7 |
8 | #include "ResultBackgroundLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | bool ResultBackgroundLayer::init() {
13 | auto listenerkeyPad = EventListenerKeyboard::create();
14 | listenerkeyPad->onKeyReleased = CC_CALLBACK_2(ResultBackgroundLayer::onKeyReleased, this);
15 | _eventDispatcher->addEventListenerWithSceneGraphPriority(listenerkeyPad, this);
16 |
17 | auto background = Sprite::createWithSpriteFrameName("img_bg_welcome.jpg");
18 | background->setAnchorPoint(Point(0, 0));
19 | background->setScale(2);
20 | this->addChild(background);
21 | return true;
22 | }
23 |
24 | void ResultBackgroundLayer::setIsWin(bool isWin) {
25 | this->isWin = isWin;
26 | }
27 |
28 | void ResultBackgroundLayer::setScore(int score) {
29 | this->score = score;
30 | }
31 |
32 | void ResultBackgroundLayer::displayInfomation() {
33 | std::string strScore;
34 | std::strstream ss;
35 | ss << this->score;
36 | ss >> strScore;
37 |
38 | TTFConfig ttfConfig("fonts/MarkerFelt.ttf", 100);
39 |
40 | scoreLabel = Label::createWithTTF(ttfConfig, strScore.c_str(), TextHAlignment::CENTER);
41 |
42 | if (this->isWin == true) {
43 | winOrLose = Label::createWithTTF(ttfConfig, "WIN!!!", TextHAlignment::CENTER);
44 | winOrLose->enableShadow();
45 | winOrLose->setColor(Color3B(255, 201, 37));
46 | scoreLabel->setColor(Color3B(255, 201, 37));
47 | } else {
48 | winOrLose = Label::createWithTTF(ttfConfig, "LOSE", TextHAlignment::CENTER);
49 | winOrLose->enableShadow();
50 | winOrLose->setColor(Color3B(100, 100, 100));
51 | scoreLabel->setColor(Color3B(100, 100, 100));
52 | }
53 |
54 | winOrLose->setPosition(Director::getInstance()->getWinSize().width / 2, Director::getInstance()->getWinSize().height / 2 + 200);
55 | this->addChild(winOrLose);
56 |
57 | scoreLabel->setPosition(Director::getInstance()->getWinSize().width / 2, Director::getInstance()->getWinSize().height / 2);
58 | this->addChild(scoreLabel);
59 |
60 | }
61 |
62 | void ResultBackgroundLayer::onKeyReleased(EventKeyboard::KeyCode keycode, Event* event) {
63 | switch (keycode) {
64 | case EventKeyboard::KeyCode::KEY_BACK:
65 | Director::getInstance()->end();
66 | break;
67 | default:
68 | break;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Classes/ResultBackgroundLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ResultBackgroundLayer.h
3 | *
4 | * Created on: 2015年1月27日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef RESULTBACKGROUNDLAYER_H_
9 | #define RESULTBACKGROUNDLAYER_H_
10 |
11 | #include "cocos2d.h"
12 | #include
13 |
14 | class ResultBackgroundLayer : public cocos2d::Layer{
15 | public:
16 | CREATE_FUNC(ResultBackgroundLayer);
17 | void setIsWin(bool isWin);
18 | void setScore(int score);
19 | void displayInfomation();
20 | private:
21 | bool isWin;
22 | int score;
23 | cocos2d::Label* winOrLose;
24 | cocos2d::Label* scoreLabel;
25 |
26 | virtual bool init() override;
27 | virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keycode, cocos2d::Event* event) override;//对应back键
28 | };
29 |
30 | #endif /* RESULTBACKGROUNDLAYER_H_ */
31 |
--------------------------------------------------------------------------------
/Classes/ResultButtonLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * ResultButtonLayer.cpp
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #include "ResultButtonLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | bool ResultButtonLayer::init() {
13 | MenuItemSprite* restartGameButtonItemSprite = MenuItemSprite::create(Sprite::createWithSpriteFrameName("restartGameButton.png"), Sprite::createWithSpriteFrameName("restartGameButton.png"), CC_CALLBACK_1(ResultButtonLayer::restartGameButtonCallback, this));
14 | Menu* restartGameButton = Menu::create(restartGameButtonItemSprite, nullptr);
15 | restartGameButton->setPosition(Director::getInstance()->getWinSize().width/2,400);
16 | this->addChild(restartGameButton);
17 |
18 | MenuItemSprite* backToMenuButtonItemSprite = MenuItemSprite::create(Sprite::createWithSpriteFrameName("backToMenuButton.png"), Sprite::createWithSpriteFrameName("backToMenuButton.png"), CC_CALLBACK_1(ResultButtonLayer::backToMenuButtonCallback, this));
19 | Menu* backToMenuButton = Menu::create(backToMenuButtonItemSprite, nullptr);
20 | backToMenuButton->setPosition(Director::getInstance()->getWinSize().width/2,330);
21 | this->addChild(backToMenuButton);
22 |
23 | return true;
24 | }
25 |
26 | void ResultButtonLayer::restartGameButtonCallback(Ref* pSender){
27 | Scene* welcomeScene = TransitionFade::create(2.0f,GameScene::create());
28 | Director::getInstance()->replaceScene(welcomeScene);
29 | }
30 |
31 | void ResultButtonLayer::backToMenuButtonCallback(Ref* pSender){
32 | Scene* welcomeScene = TransitionFade::create(2.0f,WelcomeScene::create());
33 | Director::getInstance()->replaceScene(welcomeScene);
34 | }
35 |
--------------------------------------------------------------------------------
/Classes/ResultButtonLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ResultButtonLayer.h
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef RESULTBUTTONLAYER_H_
9 | #define RESULTBUTTONLAYER_H_
10 |
11 | #include "cocos2d.h"
12 | #include "GameScene.h"
13 | #include "WelcomeScene.h"
14 |
15 | class ResultButtonLayer : public cocos2d::Layer{
16 | public:
17 | CREATE_FUNC(ResultButtonLayer);
18 | private:
19 | void restartGameButtonCallback(Ref* pSender);
20 | void backToMenuButtonCallback(Ref* pSender);
21 | virtual bool init() override;
22 | };
23 |
24 | #endif /* RESULTBUTTONLAYER_H_ */
25 |
--------------------------------------------------------------------------------
/Classes/ResultScene.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * ResultScene.cpp
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #include "ResultScene.h"
9 |
10 | USING_NS_CC;
11 |
12 | Scene* ResultScene::resultScene = nullptr;
13 |
14 | Scene* ResultScene::create(bool isWin, int score) {
15 | resultScene = Scene::create();
16 |
17 | ResultBackgroundLayer* resultBackgroundLayer = ResultBackgroundLayer::create();
18 | resultBackgroundLayer->setParent(resultScene);
19 | resultScene->addChild(resultBackgroundLayer);
20 |
21 | resultBackgroundLayer->setIsWin(isWin);
22 | resultBackgroundLayer->setScore(score);
23 | resultBackgroundLayer->displayInfomation();
24 |
25 | ResultButtonLayer* resultButtonLayer = ResultButtonLayer::create();
26 | resultButtonLayer->setParent(resultScene);
27 | resultScene->addChild(resultButtonLayer);
28 |
29 | return resultScene;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/Classes/ResultScene.h:
--------------------------------------------------------------------------------
1 | /*
2 | * ResultScene.h
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef RESULTSCENE_H_
9 | #define RESULTSCENE_H_
10 |
11 | #include "cocos2d.h"
12 | #include "ResultButtonLayer.h"
13 | #include "ResultBackgroundLayer.h"
14 |
15 | class ResultScene :public cocos2d::Scene{
16 | public:
17 | static Scene* create(bool isWin, int score);
18 | private:
19 | static Scene* resultScene;
20 | };
21 |
22 | #endif /* RESULTSCENE_H_ */
23 |
--------------------------------------------------------------------------------
/Classes/SelectBackgroundLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectBackground.cpp
3 | *
4 | * Created on: 2015年1月30日
5 | * Author: netbeen
6 | */
7 |
8 | #include "SelectBackgroundLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | bool SelectBackgroundLayer::init() {
13 | auto listenerkeyPad = EventListenerKeyboard::create();
14 | listenerkeyPad->onKeyReleased = CC_CALLBACK_2(SelectBackgroundLayer::onKeyReleased, this);
15 | _eventDispatcher->addEventListenerWithSceneGraphPriority(listenerkeyPad, this);
16 |
17 | Sprite* background = Sprite::createWithSpriteFrameName("selectSceneBackground.jpg");
18 | background->setScale(2.0f);
19 | background->setAnchorPoint(Point(0, 0));
20 | this->addChild(background);
21 |
22 | Sprite* blank1 = Sprite::createWithSpriteFrameName("img_bg_1.jpg");
23 | blank1->setScale(0.5);
24 | //blank1->setAnchorPoint(Point(0, 0));
25 | blank1->setPosition(165, 860);
26 | this->addChild(blank1);
27 |
28 | Sprite* blank2 = Sprite::createWithSpriteFrameName("img_bg_2.jpg");
29 | blank2->setScale(0.5);
30 | blank2->setPosition(365, 860);
31 | this->addChild(blank2);
32 | Sprite* blank2_locked = Sprite::createWithSpriteFrameName("locked.png");
33 | blank2_locked->setPosition(365, 860);
34 | this->addChild(blank2_locked);
35 |
36 | Sprite* blank3 = Sprite::createWithSpriteFrameName("img_bg_3.jpg");
37 | blank3->setScale(0.5);
38 | blank3->setPosition(565, 860);
39 | this->addChild(blank3);
40 | Sprite* blank3_locked = Sprite::createWithSpriteFrameName("locked.png");
41 | blank3_locked->setPosition(565, 860);
42 | this->addChild(blank3_locked);
43 |
44 | Sprite* blank4 = Sprite::createWithSpriteFrameName("img_bg_4.jpg");
45 | blank4->setScale(0.5);
46 | blank4->setPosition(165, 510);
47 | this->addChild(blank4);
48 | Sprite* blank4_locked = Sprite::createWithSpriteFrameName("locked.png");
49 | blank4_locked->setPosition(165, 510);
50 | this->addChild(blank4_locked);
51 |
52 | Sprite* blank5 = Sprite::createWithSpriteFrameName("img_bg_5.jpg");
53 | blank5->setScale(0.5);
54 | blank5->setPosition(365, 510);
55 | this->addChild(blank5);
56 | Sprite* blank5_locked = Sprite::createWithSpriteFrameName("locked.png");
57 | blank5_locked->setPosition(365, 510);
58 | this->addChild(blank5_locked);
59 |
60 | Sprite* blank6 = Sprite::createWithSpriteFrameName("blank.png");
61 | blank6->setPosition(565, 510);
62 | this->addChild(blank6);
63 | Sprite* blank6_locked = Sprite::createWithSpriteFrameName("locked.png");
64 | blank6_locked->setPosition(565, 510);
65 | this->addChild(blank6_locked);
66 |
67 | TTFConfig ttfConfig("fonts/SIMLI.TTF", 100);
68 |
69 | Label* titleLabel = Label::createWithTTF(ttfConfig, "选择关卡", TextHAlignment::CENTER);
70 | titleLabel->enableShadow();
71 | titleLabel->setColor(Color3B(255, 201, 37));
72 | titleLabel->setPosition(Director::getInstance()->getWinSize().width / 2, Director::getInstance()->getWinSize().height - 100);
73 | this->addChild(titleLabel);
74 | return true;
75 | }
76 |
77 | void SelectBackgroundLayer::onKeyReleased(EventKeyboard::KeyCode keycode, Event* event) {
78 | switch (keycode) {
79 | case EventKeyboard::KeyCode::KEY_BACK:
80 | Director::getInstance()->end();
81 | break;
82 | default:
83 | break;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Classes/SelectBackgroundLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectBackground.h
3 | *
4 | * Created on: 2015年1月30日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef SELECTBACKGROUNDLAYER_H_
9 | #define SELECTBACKGROUNDLAYER_H_
10 |
11 | #include "cocos2d.h"
12 |
13 | class SelectBackgroundLayer : public cocos2d::Layer{
14 | public:
15 | CREATE_FUNC(SelectBackgroundLayer);
16 | private:
17 | virtual bool init() override;
18 | virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keycode, cocos2d::Event* event) override;//对应back键
19 | };
20 |
21 | #endif /* SELECTBACKGROUNDLAYER_H_ */
22 |
--------------------------------------------------------------------------------
/Classes/SelectButtonLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectButtonLayer.cpp
3 | *
4 | * Created on: 2015年1月30日
5 | * Author: netbeen
6 | */
7 |
8 | #include "SelectButtonLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | bool SelectButtonLayer::init() {
13 | MenuItemSprite* startGameButtonItemSprite = MenuItemSprite::create(Sprite::createWithSpriteFrameName("selectStartButton.png"), Sprite::createWithSpriteFrameName("selectStartButton.png"), CC_CALLBACK_1(SelectButtonLayer::startGameButtonCallback, this));
14 | Menu* startGameButton = Menu::create(startGameButtonItemSprite, nullptr);
15 | startGameButton->setPosition(Director::getInstance()->getWinSize().width/2,170);
16 | this->addChild(startGameButton);
17 |
18 | return true;
19 | }
20 |
21 | void SelectButtonLayer::startGameButtonCallback(Ref* pSender){
22 | Scene* resultSceneWithAnimation = TransitionFade::create(2.0f, GameScene::create());
23 | Director::getInstance()->replaceScene(resultSceneWithAnimation);
24 | }
25 |
--------------------------------------------------------------------------------
/Classes/SelectButtonLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectButtonLayer.h
3 | *
4 | * Created on: 2015年1月30日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef SELECTBUTTONLAYER_H_
9 | #define SELECTBUTTONLAYER_H_
10 |
11 | #include "cocos2d.h"
12 | #include "GameScene.h"
13 |
14 | class SelectButtonLayer :public cocos2d::Layer{
15 | public:
16 | CREATE_FUNC(SelectButtonLayer);
17 | private:
18 | virtual bool init() override;
19 | void startGameButtonCallback(Ref* pSender);
20 |
21 | };
22 |
23 | #endif /* SELECTBUTTONLAYER_H_ */
24 |
--------------------------------------------------------------------------------
/Classes/SelectScene.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectScene.cpp
3 | *
4 | * Created on: 2015年1月30日
5 | * Author: netbeen
6 | */
7 |
8 | #include "SelectScene.h"
9 |
10 | USING_NS_CC;
11 |
12 | Scene* SelectScene::selectScene = nullptr;
13 |
14 | Scene* SelectScene::create() {
15 | selectScene = Scene::create();
16 |
17 | SelectBackgroundLayer* selectBackgroundLayer = SelectBackgroundLayer::create();
18 | selectBackgroundLayer->setParent(selectScene);
19 | selectScene->addChild(selectBackgroundLayer);
20 |
21 | SelectButtonLayer* selectButtonLayer = SelectButtonLayer::create();
22 | selectButtonLayer->setParent(selectScene);
23 | selectScene->addChild(selectButtonLayer);
24 |
25 | return selectScene;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/Classes/SelectScene.h:
--------------------------------------------------------------------------------
1 | /*
2 | * SelectScene.h
3 | *
4 | * Created on: 2015年1月30日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef SELECTSCENE_H_
9 | #define SELECTSCENE_H_
10 |
11 | #include "cocos2d.h"
12 | #include "SelectBackgroundLayer.h"
13 | #include "SelectButtonLayer.h"
14 |
15 | class SelectScene : public cocos2d::Scene{
16 | public:
17 | static Scene* create();
18 | private:
19 | static Scene* selectScene;
20 |
21 | };
22 |
23 | #endif /* SELECTSCENE_H_ */
24 |
--------------------------------------------------------------------------------
/Classes/UFOLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * UFOLayer.cpp
3 | *
4 | * Created on: 2015年1月21日
5 | * Author: netbeen
6 | */
7 |
8 | #include "UFOLayer.h"
9 |
10 | #include "ControlLayer.h"
11 | #include "UFOUserData.h"
12 | #include "BulletLayer.h"
13 | #include "GameScene.h"
14 |
15 | USING_NS_CC;
16 |
17 | UFOLayer::UFOLayer() :
18 | winSize(Director::getInstance()->getWinSize()), sequenceBack(nullptr), sequenceFront(nullptr) {
19 | }
20 |
21 | bool UFOLayer::init() {
22 | std::string name1 = "bigBombGet.png"; // Kind 0
23 | std::string name2 = "bulletUpgrade.png"; // Kind 1
24 | giftTextureName.push_back(name1);
25 | giftTextureName.push_back(name2);
26 |
27 | giftFlyTime.push_back(UserDefault::getInstance()->getIntegerForKey("FlytimeOfGiftBigBomb"));
28 | giftFlyTime.push_back(UserDefault::getInstance()->getIntegerForKey("FlytimeOfGiftLevelUp"));
29 |
30 | this->scheduleUpdate();
31 | return true;
32 | }
33 |
34 | void UFOLayer::addGiftSprite() {
35 | float testProbability = CCRANDOM_0_1();
36 | int giftKinds;
37 | if(testProbability < 0.5) {
38 | giftKinds = 0;
39 | } else {
40 | giftKinds = 1;
41 | }
42 | Sprite* giftSprite = Sprite::createWithSpriteFrameName(giftTextureName[giftKinds].c_str());
43 | int randomX = CCRANDOM_0_1()*winSize.width;
44 | giftSprite->setPosition(randomX, winSize.height +giftSprite->getContentSize().height/2 );
45 | giftSprite->setUserData(new UFOUserData(giftKinds));
46 | this->addChild(giftSprite);
47 | allGift.pushBack(giftSprite);
48 |
49 | FiniteTimeAction* giftMove = MoveTo::create(giftFlyTime[giftKinds], Point(randomX, - giftSprite->getContentSize().height/2));
50 | FiniteTimeAction* giftRemove = CallFuncN::create(CC_CALLBACK_1(UFOLayer::giftMoveFinished, this));
51 | Action* giftAction = Sequence::create(giftMove, giftRemove, NULL);
52 | giftSprite->runAction(giftAction);
53 | }
54 |
55 | void UFOLayer::giftMoveFinished(Node* pSender) {
56 | Sprite* gift = (Sprite*) pSender;
57 | delete static_cast(gift->getUserData());
58 | allGift.eraseObject(gift);
59 | this->removeChild(gift, true);
60 | }
61 |
62 | void UFOLayer::update(float useless) {
63 | for (Sprite* gift : this->allGift) {
64 | //判断我方飞机是否与gift碰撞
65 | if (gift->getBoundingBox().intersectsRect(static_cast(this->getParent())->getPlaneLayer()->getMyPlane()->getBoundingBox())) {
66 |
67 | if (static_cast(gift->getUserData())->getGiftKind() == 0) {
68 | static_cast(this->getParent())->getControlLayer()->setLaunchButtonEnable();
69 | } else {
70 | static_cast(this->getParent())->getBulletLayer()->setBulletLevelUP();
71 | }
72 | this->showAnnotation(gift);
73 | this->giftMoveFinished(gift);
74 | }
75 | //end判断我方飞机是否与gift碰撞
76 | }
77 | }
78 |
79 | void UFOLayer::showAnnotation(Sprite* gift) {
80 | Sprite* bulletLevelUp1;
81 | Sprite* bulletLevelUp2;
82 | if(static_cast(gift->getUserData())->getGiftKind() == 0){
83 | bulletLevelUp1 = Sprite::createWithSpriteFrameName("getBigBomb1.png");
84 | bulletLevelUp2 = Sprite::createWithSpriteFrameName("getBigBomb2.png");
85 | }else{
86 | bulletLevelUp1 = Sprite::createWithSpriteFrameName("bulletLevelUp1.png");
87 | bulletLevelUp2 = Sprite::createWithSpriteFrameName("bulletLevelUp2.png");
88 | }
89 | sequenceFront = Sequence::create(FadeIn::create(0.5f), FadeOut::create(2.0f), NULL);
90 | sequenceBack = Sequence::create(FadeIn::create(1.0f), FadeOut::create(3.0f), NULL);
91 | bulletLevelUp1->setPosition(gift->getPosition());
92 | bulletLevelUp1->setScale(2.0f);
93 | bulletLevelUp1->setOpacity(0);
94 | bulletLevelUp2->setPosition(gift->getPosition());
95 | bulletLevelUp2->setScale(2.0f);
96 | bulletLevelUp2->setOpacity(0);
97 | this->addChild(bulletLevelUp1);
98 | this->addChild(bulletLevelUp2);
99 | bulletLevelUp1->runAction(sequenceFront);
100 | bulletLevelUp2->runAction(sequenceBack);
101 | }
102 |
--------------------------------------------------------------------------------
/Classes/UFOLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * UFOLayer.h
3 | *
4 | * Created on: 2015年1月21日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef UFOLAYER_H_
9 | #define UFOLAYER_H_
10 |
11 | #include
12 | #include
13 | #include "cocos2d.h"
14 |
15 |
16 | class UFOLayer : public cocos2d::Layer{
17 | public:
18 | CREATE_FUNC(UFOLayer);
19 | void addGiftSprite();
20 | private:
21 | std::vector giftTextureName;
22 | std::vector giftFlyTime;
23 | cocos2d::Vector allGift;
24 | cocos2d::Size winSize;
25 | cocos2d::Sequence* sequenceFront;
26 | cocos2d::Sequence* sequenceBack;
27 |
28 | virtual bool init() override;
29 | void giftMoveFinished(cocos2d::Node* pSender);
30 | UFOLayer();
31 | void update(float useless) override;
32 | void showAnnotation(cocos2d::Sprite* gift);
33 | };
34 |
35 | #endif /* UFOLAYER_H_ */
36 |
--------------------------------------------------------------------------------
/Classes/UFOUserData.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * UFOUserData.cpp
3 | *
4 | * Created on: 2015年1月23日
5 | * Author: netbeen
6 | */
7 |
8 | #include "UFOUserData.h"
9 |
10 | UFOUserData::UFOUserData(int initGiftKind):giftKind(initGiftKind){
11 | }
12 |
13 | int UFOUserData::getGiftKind(){
14 | return giftKind;
15 | }
16 |
--------------------------------------------------------------------------------
/Classes/UFOUserData.h:
--------------------------------------------------------------------------------
1 | /*
2 | * UFOUserData.h
3 | *
4 | * Created on: 2015年1月23日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef UFOUSERDATA_H_
9 | #define UFOUSERDATA_H_
10 |
11 | class UFOUserData {
12 | public:
13 | UFOUserData(int initGiftKind);
14 | int getGiftKind();
15 | private:
16 | int giftKind;
17 | };
18 |
19 | #endif /* UFOUSERDATA_H_ */
20 |
--------------------------------------------------------------------------------
/Classes/WelcomeBackgroundLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * WelcomeBackgroundLayer.cpp
3 | *
4 | * Created on: 2015年1月27日
5 | * Author: netbeen
6 | */
7 |
8 | #include "WelcomeBackgroundLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | bool WelcomeBackgroundLayer::init() {
13 | auto listenerkeyPad = EventListenerKeyboard::create();
14 | listenerkeyPad->onKeyReleased = CC_CALLBACK_2(WelcomeBackgroundLayer::onKeyReleased, this);
15 | _eventDispatcher->addEventListenerWithSceneGraphPriority(listenerkeyPad, this);
16 |
17 | Sprite* background = Sprite::createWithSpriteFrameName("img_bg_welcome.jpg");
18 | background->setAnchorPoint(Point(0, 0));
19 | background->setScale(2);
20 | this->addChild(background);
21 |
22 | Sprite* logo = Sprite::createWithSpriteFrameName("logo.png");
23 | logo->setAnchorPoint(Point(0.5, 0.5));
24 | logo->setPosition(Director::getInstance()->getWinSize().width / 2, 650);
25 | this->addChild(logo);
26 |
27 | return true;
28 | }
29 |
30 | void WelcomeBackgroundLayer::onKeyReleased(EventKeyboard::KeyCode keycode, Event* event) {
31 | switch (keycode) {
32 | case EventKeyboard::KeyCode::KEY_BACK:
33 | Director::getInstance()->end();
34 | break;
35 | default:
36 | break;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Classes/WelcomeBackgroundLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * WelcomeBackgroundLayer.h
3 | *
4 | * Created on: 2015年1月27日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef WELCOMEBACKGROUNDLAYER_H_
9 | #define WELCOMEBACKGROUNDLAYER_H_
10 |
11 | #include "cocos2d.h"
12 |
13 | class WelcomeBackgroundLayer : public cocos2d::Layer{
14 | public:
15 | CREATE_FUNC(WelcomeBackgroundLayer);
16 | private:
17 | virtual bool init() override;
18 | virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keycode, cocos2d::Event* event) override;//对应back键
19 | };
20 |
21 | #endif /* WELCOMEBACKGROUNDLAYER_H_ */
22 |
--------------------------------------------------------------------------------
/Classes/WelcomeButtonLayer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * WelcomeButtonLayer.cpp
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #include "WelcomeButtonLayer.h"
9 |
10 | USING_NS_CC;
11 |
12 | bool WelcomeButtonLayer::init() {
13 | MenuItemSprite* startGameButtonItemSprite = MenuItemSprite::create(Sprite::createWithSpriteFrameName("startGameButton.png"), Sprite::createWithSpriteFrameName("startGameButton.png"), CC_CALLBACK_1(WelcomeButtonLayer::startGameButtonCallback, this));
14 | Menu* startGameButton = Menu::create(startGameButtonItemSprite, nullptr);
15 | startGameButton->setAnchorPoint(Point(0.0f, 1.0f));
16 | startGameButton->setPosition(Director::getInstance()->getWinSize().width/2, 200);
17 | this->addChild(startGameButton);
18 | return true;
19 | }
20 |
21 | void WelcomeButtonLayer::startGameButtonCallback(Ref* pSender) {
22 | Scene* resultSceneWithAnimation = TransitionFade::create(2.0f, SelectScene::create());
23 | Director::getInstance()->replaceScene(resultSceneWithAnimation);
24 | }
25 |
--------------------------------------------------------------------------------
/Classes/WelcomeButtonLayer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * WelcomeButtonLayer.h
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef WELCOMEBUTTONLAYER_H_
9 | #define WELCOMEBUTTONLAYER_H_
10 |
11 | #include "cocos2d.h"
12 | #include "GameScene.h"
13 | #include "SelectScene.h"
14 |
15 | class WelcomeButtonLayer : public cocos2d::Layer{
16 | public:
17 | CREATE_FUNC(WelcomeButtonLayer);
18 | private:
19 | void startGameButtonCallback(Ref* pSender);
20 | virtual bool init() override;
21 | };
22 |
23 | #endif /* WELCOMEBUTTONLAYER_H_ */
24 |
--------------------------------------------------------------------------------
/Classes/WelcomeScene.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * WelcomeScene.cpp
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #include "WelcomeScene.h"
9 |
10 | USING_NS_CC;
11 |
12 | Scene* WelcomeScene::welcomeScene = nullptr;
13 | WelcomeButtonLayer* WelcomeScene::welcomeButtonLayer = nullptr;
14 | WelcomeBackgroundLayer* WelcomeScene::welcomeBackgroundLayer = nullptr;
15 |
16 | Scene* WelcomeScene::create() {
17 | Scene* welcomeScene = Scene::create();
18 |
19 | welcomeBackgroundLayer = WelcomeBackgroundLayer::create();
20 | welcomeBackgroundLayer->setParent(welcomeScene);
21 | welcomeScene->addChild(welcomeBackgroundLayer);
22 |
23 | welcomeButtonLayer = WelcomeButtonLayer::create();
24 | welcomeButtonLayer->setParent(welcomeScene);
25 | welcomeScene->addChild(welcomeButtonLayer);
26 |
27 | return welcomeScene;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/Classes/WelcomeScene.h:
--------------------------------------------------------------------------------
1 | /*
2 | * WelcomeScene.h
3 | *
4 | * Created on: 2015年1月25日
5 | * Author: netbeen
6 | */
7 |
8 | #ifndef WELCOMESCENE_H_
9 | #define WELCOMESCENE_H_
10 |
11 | #include "cocos2d.h"
12 | #include "WelcomeButtonLayer.h"
13 | #include "WelcomeBackgroundLayer.h"
14 |
15 | class WelcomeScene : public cocos2d::Scene{
16 | public:
17 | static cocos2d::Scene* create();
18 | private:
19 | static Scene* welcomeScene;
20 | static WelcomeButtonLayer* welcomeButtonLayer;
21 | static WelcomeBackgroundLayer* welcomeBackgroundLayer;
22 | };
23 |
24 | #endif /* WELCOMESCENE_H_ */
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 NetBeen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flyingACE (王牌飞行员)
2 | - **Difficult in Chinese? -> [English Version](#EnglishTitle)**
3 | - 这是一个使用Cocos2d-x-3.X 开发的飞机大战游戏,实际版本为Cocos2d-x3.3
4 | - 开发博客:[https://blog.csdn.net/yy19900806/article/category/2856067/]([https://blog.csdn.net/yy19900806/article/category/2856067/])
5 | - Cocos引擎中文官网同步更新:[https://cn.cocos2d-x.org/tutorial/lists?id=154](https://cn.cocos2d-x.org/tutorial/lists?id=154)
6 | - 优酷 Demo:[https://v.youku.com/v_show/id_XODg3ODY2Mjg0](https://v.youku.com/v_show/id_XODg3ODY2Mjg0)
7 | - Youtube Demo:[https://www.youtube.com/watch?v=EL8_TlL1kLY](https://www.youtube.com/watch?v=EL8_TlL1kLY)
8 |
9 | ---
10 |
11 | ## 开发环境 Dev Environment
12 | - Linux OS (Ubuntu 14.04 LTS)
13 | - Eclipse 4.4.1
14 | - Cocos2d-x-3.3
15 | - Android SDK 4.4.2 (API 19)
16 | - Android NDK r10d
17 | - gcc 4.8
18 |
19 | ---
20 |
21 | ## 配置方法 Configure
22 | ```shell
23 | mkdir MyGame && mkdir -p MyGame/cocos2dNew && cd MyGame
24 | cocos new FlyingACE -l cpp -p com.YOURNAME.flyingACE -d cocos2dNew/
25 | git clone https://github.com/netbeen/flyingACE.git
26 | rm -r cocos2dNew/FlyingACE/Classes/ && rm -r cocos2dNew/FlyingACE/Resources/ && rm cocos2dNew/FlyingACE/proj.android/jni/Android.mk
27 | cp -r cocos2dNew/FlyingACE/* flyingACE/
28 | sed -i 's/screenOrientation="landscape"/screenOrientation="reversePortrait"/' flyingACE/proj.android/AndroidManifest.xml
29 | rm -r cocos2dNew/
30 | ```
31 | - 然后用Eclipse导入Android工程即可。
32 |
33 | ---
34 |
35 | # 游戏界面 GUI
36 |
37 | https://user-images.githubusercontent.com/1592533/141647497-3954a1f5-138e-4305-bc68-87a81e0b6e4d.mp4
38 |
39 |
40 | ---
41 |
42 | ## 类功能分布 Files
43 | - AppDelegate: 程序入口,初始化Director类的参数,场景构建,布景层挂载
44 | - BulletLayer: 子弹层,用批量渲染技术加载子弹并维护子弹数据
45 | - BulletUserData: 子弹数据
46 | - ControlLayer: 游戏控制层,负责分数显示和暂停按钮
47 | - EnemyLayer: 敌机层,加载敌机并维护敌机数据,检测敌机与子弹、敌机与我机及碰撞
48 | - EnemyUserData: 敌机数据
49 | - GameBackgroundLayer: 布景层,实现地图加载,循环滚动
50 | - GameScene: 游戏主场景
51 | - PlaneLayer: 飞机层,渲染飞机动画,响应用户滑屏操作
52 | - PlaneUserData: 飞机数据
53 | - ResultBackgroundLayer: 游戏结果场景中显示背景图片的层
54 | - ResultButtonLayer: 游戏结果场景中显示并回调按钮事件的层
55 | - ResultScene: 游戏结果场景
56 | - SelectBackgroundLayer: 选择关卡界面背景层
57 | - SelectButtonLayer: 选择关卡界面按钮层
58 | - SelectScene: 选择关卡场景
59 | - UFOLayer: 不明飞行物层,目前用于投放武器加强的buff和大招buff
60 | - UFOUserData: 数据记录类,用于记录gift的类型
61 | - WelcomeBackgroundLayer: 欢迎界面中的背景层
62 | - WelcomeButtonLayer: 欢迎界面中的按钮回调函数
63 | - WelcomeScene: 欢迎界面
64 |
65 | ---
66 |
67 | # 鸣谢 Thanks
68 | - 特别感谢TexturePacker的作者Andreas Löw为本次开发提供Pro版的序列号
69 | - Thanks to Mr. Andreas Löw (the author of TexturePacker), for prividing the free key of TexturePacker pro.
70 |
71 | ---
72 |
73 | # 联系方式 Contact Me
74 | - Email: netbeen.cn@gmail.com
75 | - QQ: 394062113
76 |
77 | ---
78 |
79 | # 关键字 Keywords
80 | - `cocos` `cocos2d` `cocos2dx` `cocos2dx3.0`
81 |
82 | ---
83 |
84 | # flyingACE ( Document in English )
85 | - This is a Cocos2dx game about aircraft fighting (using Cocos2dx binding C++). During this commit, the version of my Cocos2d is Cocos2d-x3.3.
86 | - Development Blog [https://blog.csdn.net/yy19900806/article/category/2856067/](https://blog.csdn.net/yy19900806/article/category/2856067/)
87 | - Youku Demo: [https://v.youku.com/v_show/id_XODg3ODY2Mjg0](https://v.youku.com/v_show/id_XODg3ODY2Mjg0)
88 | - Youtube Demo:[https://www.youtube.com/watch?v=EL8_TlL1kLY](https://www.youtube.com/watch?v=EL8_TlL1kLY)
89 |
90 | ---
91 |
92 | ## Dev Environment
93 | - Linux OS (Ubuntu 14.04 LTS)
94 | - Eclipse 4.4.1
95 | - Cocos2d-x-3.3
96 | - Android SDK 4.4.2 (API 19)
97 | - Android NDK r10d
98 | - gcc 4.8
99 |
100 | ---
101 |
102 | ## Configure
103 | ```shell
104 | mkdir MyGame && mkdir -p MyGame/cocos2dNew && cd MyGame
105 | cocos new FlyingACE -l cpp -p com.YOURNAME.flyingACE -d cocos2dNew/
106 | git clone https://github.com/netbeen/flyingACE.git
107 | rm -r cocos2dNew/FlyingACE/Classes/ && rm -r cocos2dNew/FlyingACE/Resources/ && rm cocos2dNew/FlyingACE/proj.android/jni/Android.mk
108 | cp -r cocos2dNew/FlyingACE/* flyingACE/
109 | sed -i 's/screenOrientation="landscape"/screenOrientation="reversePortrait"/' flyingACE/proj.android/AndroidManifest.xml
110 | rm -r cocos2dNew/
111 | ```
112 | - And then, Import the project with Eclipse for Android project.
113 |
114 | ---
115 |
116 | # GUI
117 | https://user-images.githubusercontent.com/1592533/141647497-3954a1f5-138e-4305-bc68-87a81e0b6e4d.mp4
118 |
119 | ---
120 |
121 | ## Files
122 | - AppDelegate: The init access of the program. Init the Direct and construct the Scenes.
123 | - BulletLayer: Bullet Layer, using SpriteBatchNode to load bullets.
124 | - BulletUserData: The data struct defined by myself. Recording the damage of each bullet.
125 | - ControlLayer: Game Control Layer, it provide the function of displaying scrore and pause button.
126 | - EnemyLayer: Loading the enemys, and also, prividing the interface of the crash detecting.
127 | - EnemyUserData: The datastruct recording the some paramater of enemy plane, like HP.
128 | - GameBackgroundLayer: Background Layer, auto loading the background image and rolling.
129 | - GameScene: The main scene of the game, contain the most object.
130 | - PlaneLayer: Plane Layer, Interactive layer of the game.
131 | - PlaneUserData: The datastruct recording the some paramater of enemy plane, like HP.
132 | - ResultBackgroundLayer: Show the background image in the result scene.
133 | - ResultButtonLayer: Show the button in the result scene.
134 | - ResultScene: Game result scene.
135 | - SelectBackgroundLayer: To show Select Scene's background.
136 | - SelectButtonLayer: To show Select Scene's button.
137 | - SelectScene: Select Scene.
138 | - UFOLayer: This layer is used for some buffs, like enhance the bullet or get the big bomb.
139 | - UFOUserData: The data structure recording the kind of UFO gift.
140 | - WelcomeBackgroundLayer: Show the background image in the welcome scene.
141 | - WelcomeButtonLayer: Show the button in the welcome scene.
142 | - WelcomeScene: Welcome scene, the loading image.
143 |
144 | ---
145 |
146 | # Thanks
147 | - Thanks to Mr. Andreas Löw (the author of TexturePacker), for prividing the free key of TexturePacker pro.
148 |
149 | ---
150 |
151 | # Contact Me
152 | - Email: netbeen.cn@gmail.com
153 | - QQ: 394062113
154 |
155 | ---
156 |
157 | # Keywords
158 | - `cocos` `cocos2d` `cocos2dx` `cocos2dx3.0`
159 |
160 | ---
161 |
--------------------------------------------------------------------------------
/Resources/fonts/MarkerFelt.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/Resources/fonts/MarkerFelt.ttf
--------------------------------------------------------------------------------
/Resources/fonts/SIMLI.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/Resources/fonts/SIMLI.TTF
--------------------------------------------------------------------------------
/Resources/texture.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | frames
6 |
7 | HP.png
8 |
9 | frame
10 | {{527,1286},{199,199}}
11 | offset
12 | {0,0}
13 | rotated
14 |
15 | sourceColorRect
16 | {{0,0},{199,199}}
17 | sourceSize
18 | {199,199}
19 |
20 | HPBottom.png
21 |
22 | frame
23 | {{324,1286},{201,201}}
24 | offset
25 | {0,0}
26 | rotated
27 |
28 | sourceColorRect
29 | {{0,0},{201,201}}
30 | sourceSize
31 | {201,201}
32 |
33 | backToMenuButton.png
34 |
35 | frame
36 | {{2,1468},{214,44}}
37 | offset
38 | {0,0}
39 | rotated
40 |
41 | sourceColorRect
42 | {{0,0},{214,44}}
43 | sourceSize
44 | {214,44}
45 |
46 | bigBomb.png
47 |
48 | frame
49 | {{1459,1124},{112,219}}
50 | offset
51 | {0,0}
52 | rotated
53 |
54 | sourceColorRect
55 | {{0,0},{112,219}}
56 | sourceSize
57 | {112,219}
58 |
59 | bigBombGet.png
60 |
61 | frame
62 | {{1760,1260},{121,95}}
63 | offset
64 | {0,0}
65 | rotated
66 |
67 | sourceColorRect
68 | {{0,0},{121,95}}
69 | sourceSize
70 | {121,95}
71 |
72 | blank.png
73 |
74 | frame
75 | {{2,1286},{180,320}}
76 | offset
77 | {0,0}
78 | rotated
79 |
80 | sourceColorRect
81 | {{0,0},{180,320}}
82 | sourceSize
83 | {180,320}
84 |
85 | bossWarning.png
86 |
87 | frame
88 | {{728,1286},{225,148}}
89 | offset
90 | {0,0}
91 | rotated
92 |
93 | sourceColorRect
94 | {{0,0},{225,148}}
95 | sourceSize
96 | {225,148}
97 |
98 | bullet1.png
99 |
100 | frame
101 | {{1770,1464},{34,85}}
102 | offset
103 | {0,0}
104 | rotated
105 |
106 | sourceColorRect
107 | {{0,0},{34,85}}
108 | sourceSize
109 | {34,85}
110 |
111 | bullet2.png
112 |
113 | frame
114 | {{1055,1443},{50,107}}
115 | offset
116 | {0,0}
117 | rotated
118 |
119 | sourceColorRect
120 | {{0,0},{50,107}}
121 | sourceSize
122 | {50,107}
123 |
124 | bullet3.png
125 |
126 | frame
127 | {{1510,1395},{65,112}}
128 | offset
129 | {0,0}
130 | rotated
131 |
132 | sourceColorRect
133 | {{0,0},{65,112}}
134 | sourceSize
135 | {65,112}
136 |
137 | bulletLevelUp1.png
138 |
139 | frame
140 | {{925,1436},{122,28}}
141 | offset
142 | {0,0}
143 | rotated
144 |
145 | sourceColorRect
146 | {{0,0},{122,28}}
147 | sourceSize
148 | {122,28}
149 |
150 | bulletLevelUp2.png
151 |
152 | frame
153 | {{1412,1509},{122,28}}
154 | offset
155 | {0,0}
156 | rotated
157 |
158 | sourceColorRect
159 | {{0,0},{122,28}}
160 | sourceSize
161 | {122,28}
162 |
163 | bulletUpgrade.png
164 |
165 | frame
166 | {{1770,1383},{79,79}}
167 | offset
168 | {0,0}
169 | rotated
170 |
171 | sourceColorRect
172 | {{0,0},{79,79}}
173 | sourceSize
174 | {79,79}
175 |
176 | enemy1.png
177 |
178 | frame
179 | {{765,1436},{158,118}}
180 | offset
181 | {0,0}
182 | rotated
183 |
184 | sourceColorRect
185 | {{0,1},{158,118}}
186 | sourceSize
187 | {158,120}
188 |
189 | enemy2.png
190 |
191 | frame
192 | {{1680,1124},{175,134}}
193 | offset
194 | {0,0}
195 | rotated
196 |
197 | sourceColorRect
198 | {{2,0},{175,134}}
199 | sourceSize
200 | {179,134}
201 |
202 | enemy3.png
203 |
204 | frame
205 | {{527,1487},{71,143}}
206 | offset
207 | {-1,1}
208 | rotated
209 |
210 | sourceColorRect
211 | {{0,0},{71,143}}
212 | sourceSize
213 | {73,145}
214 |
215 | enemyBoss.png
216 |
217 | frame
218 | {{1088,644},{568,369}}
219 | offset
220 | {0,0}
221 | rotated
222 |
223 | sourceColorRect
224 | {{1,0},{568,369}}
225 | sourceSize
226 | {570,369}
227 |
228 | enemyBossBroken.png
229 |
230 | frame
231 | {{1459,382},{568,369}}
232 | offset
233 | {0,0}
234 | rotated
235 |
236 | sourceColorRect
237 | {{1,0},{568,369}}
238 | sourceSize
239 | {570,369}
240 |
241 | enemyBossBrokenMore.png
242 |
243 | frame
244 | {{1459,753},{568,369}}
245 | offset
246 | {0,0}
247 | rotated
248 |
249 | sourceColorRect
250 | {{1,0},{568,369}}
251 | sourceSize
252 | {570,369}
253 |
254 | enemyBulletSet.png
255 |
256 | frame
257 | {{1857,1458},{61,63}}
258 | offset
259 | {0,0}
260 | rotated
261 |
262 | sourceColorRect
263 | {{0,0},{61,63}}
264 | sourceSize
265 | {61,63}
266 |
267 | explosion01.png
268 |
269 | frame
270 | {{1922,1458},{53,53}}
271 | offset
272 | {0,0}
273 | rotated
274 |
275 | sourceColorRect
276 | {{0,0},{53,53}}
277 | sourceSize
278 | {53,53}
279 |
280 | explosion02.png
281 |
282 | frame
283 | {{1577,1417},{97,97}}
284 | offset
285 | {0,0}
286 | rotated
287 |
288 | sourceColorRect
289 | {{0,0},{97,97}}
290 | sourceSize
291 | {97,97}
292 |
293 | explosion03.png
294 |
295 | frame
296 | {{1269,1417},{141,141}}
297 | offset
298 | {0,0}
299 | rotated
300 |
301 | sourceColorRect
302 | {{0,0},{141,141}}
303 | sourceSize
304 | {141,141}
305 |
306 | explosion04.png
307 |
308 | frame
309 | {{955,1286},{155,155}}
310 | offset
311 | {0,0}
312 | rotated
313 |
314 | sourceColorRect
315 | {{0,0},{155,155}}
316 | sourceSize
317 | {155,155}
318 |
319 | explosion05.png
320 |
321 | frame
322 | {{1289,1214},{155,155}}
323 | offset
324 | {0,0}
325 | rotated
326 |
327 | sourceColorRect
328 | {{0,0},{155,155}}
329 | sourceSize
330 | {155,155}
331 |
332 | explosion06.png
333 |
334 | frame
335 | {{1446,1238},{155,155}}
336 | offset
337 | {0,0}
338 | rotated
339 |
340 | sourceColorRect
341 | {{0,0},{155,155}}
342 | sourceSize
343 | {155,155}
344 |
345 | explosion07.png
346 |
347 | frame
348 | {{1603,1260},{155,155}}
349 | offset
350 | {0,0}
351 | rotated
352 |
353 | sourceColorRect
354 | {{0,0},{155,155}}
355 | sourceSize
356 | {155,155}
357 |
358 | explosion08.png
359 |
360 | frame
361 | {{1857,1301},{155,155}}
362 | offset
363 | {0,0}
364 | rotated
365 |
366 | sourceColorRect
367 | {{0,0},{155,155}}
368 | sourceSize
369 | {155,155}
370 |
371 | explosion09.png
372 |
373 | frame
374 | {{1112,1391},{155,155}}
375 | offset
376 | {0,0}
377 | rotated
378 |
379 | sourceColorRect
380 | {{0,0},{155,155}}
381 | sourceSize
382 | {155,155}
383 |
384 | getBigBomb1.png
385 |
386 | frame
387 | {{1289,1371},{107,30}}
388 | offset
389 | {0,0}
390 | rotated
391 |
392 | sourceColorRect
393 | {{0,0},{107,30}}
394 | sourceSize
395 | {107,30}
396 |
397 | getBigBomb2.png
398 |
399 | frame
400 | {{218,1468},{103,30}}
401 | offset
402 | {-1,0}
403 | rotated
404 |
405 | sourceColorRect
406 | {{1,0},{103,30}}
407 | sourceSize
408 | {107,30}
409 |
410 | img_bg_1.jpg
411 |
412 | frame
413 | {{2,2},{360,640}}
414 | offset
415 | {0,0}
416 | rotated
417 |
418 | sourceColorRect
419 | {{0,0},{360,640}}
420 | sourceSize
421 | {360,640}
422 |
423 | img_bg_2.jpg
424 |
425 | frame
426 | {{2,644},{360,640}}
427 | offset
428 | {0,0}
429 | rotated
430 |
431 | sourceColorRect
432 | {{0,0},{360,640}}
433 | sourceSize
434 | {360,640}
435 |
436 | img_bg_3.jpg
437 |
438 | frame
439 | {{364,2},{360,640}}
440 | offset
441 | {0,0}
442 | rotated
443 |
444 | sourceColorRect
445 | {{0,0},{360,640}}
446 | sourceSize
447 | {360,640}
448 |
449 | img_bg_4.jpg
450 |
451 | frame
452 | {{364,644},{360,640}}
453 | offset
454 | {0,0}
455 | rotated
456 |
457 | sourceColorRect
458 | {{0,0},{360,640}}
459 | sourceSize
460 | {360,640}
461 |
462 | img_bg_5.jpg
463 |
464 | frame
465 | {{726,2},{360,640}}
466 | offset
467 | {0,0}
468 | rotated
469 |
470 | sourceColorRect
471 | {{0,0},{360,640}}
472 | sourceSize
473 | {360,640}
474 |
475 | img_bg_welcome.jpg
476 |
477 | frame
478 | {{726,644},{360,640}}
479 | offset
480 | {0,0}
481 | rotated
482 |
483 | sourceColorRect
484 | {{0,0},{360,640}}
485 | sourceSize
486 | {360,640}
487 |
488 | launchButton.png
489 |
490 | frame
491 | {{1857,1124},{175,175}}
492 | offset
493 | {0,0}
494 | rotated
495 |
496 | sourceColorRect
497 | {{0,0},{175,175}}
498 | sourceSize
499 | {175,175}
500 |
501 | launchButtonUnable.png
502 |
503 | frame
504 | {{1112,1214},{175,175}}
505 | offset
506 | {0,0}
507 | rotated
508 |
509 | sourceColorRect
510 | {{0,0},{175,175}}
511 | sourceSize
512 | {175,175}
513 |
514 | locked.png
515 |
516 | frame
517 | {{955,1443},{98,114}}
518 | offset
519 | {1,0}
520 | rotated
521 |
522 | sourceColorRect
523 | {{16,7},{98,114}}
524 | sourceSize
525 | {128,128}
526 |
527 | logo.png
528 |
529 | frame
530 | {{1450,2},{584,378}}
531 | offset
532 | {0,0}
533 | rotated
534 |
535 | sourceColorRect
536 | {{0,0},{584,378}}
537 | sourceSize
538 | {584,378}
539 |
540 | myPlane.png
541 |
542 | frame
543 | {{672,1487},{91,71}}
544 | offset
545 | {0,0}
546 | rotated
547 |
548 | sourceColorRect
549 | {{0,0},{91,71}}
550 | sourceSize
551 | {91,71}
552 |
553 | pauseButton.png
554 |
555 | frame
556 | {{1676,1417},{92,93}}
557 | offset
558 | {-2,2}
559 | rotated
560 |
561 | sourceColorRect
562 | {{2,0},{92,93}}
563 | sourceSize
564 | {100,97}
565 |
566 | restartGameButton.png
567 |
568 | frame
569 | {{2,1514},{171,44}}
570 | offset
571 | {0,0}
572 | rotated
573 |
574 | sourceColorRect
575 | {{0,0},{171,44}}
576 | sourceSize
577 | {171,44}
578 |
579 | selectSceneBackground.jpg
580 |
581 | frame
582 | {{1088,2},{360,640}}
583 | offset
584 | {0,0}
585 | rotated
586 |
587 | sourceColorRect
588 | {{0,0},{360,640}}
589 | sourceSize
590 | {360,640}
591 |
592 | selectStartButton.png
593 |
594 | frame
595 | {{348,1489},{149,59}}
596 | offset
597 | {2,0}
598 | rotated
599 |
600 | sourceColorRect
601 | {{8,4},{149,59}}
602 | sourceSize
603 | {161,67}
604 |
605 | startButton.png
606 |
607 | frame
608 | {{1412,1395},{96,112}}
609 | offset
610 | {2,0}
611 | rotated
612 |
613 | sourceColorRect
614 | {{4,0},{96,112}}
615 | sourceSize
616 | {100,112}
617 |
618 | startGameButton.png
619 |
620 | frame
621 | {{175,1514},{171,44}}
622 | offset
623 | {0,0}
624 | rotated
625 |
626 | sourceColorRect
627 | {{0,0},{171,44}}
628 | sourceSize
629 | {171,44}
630 |
631 |
632 | metadata
633 |
634 | format
635 | 2
636 | realTextureFileName
637 | texture.png
638 | size
639 | {2036,1560}
640 | smartupdate
641 | $TexturePacker:SmartUpdate:dd88e70c9291481ee719e5bed35cdcd6:7108058307ecb8c5c2a6f9b315b90ebf:ef86396999e18097aad14daa6638d5f9$
642 | textureFileName
643 | texture.png
644 |
645 |
646 |
647 |
--------------------------------------------------------------------------------
/Resources/texture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/Resources/texture.png
--------------------------------------------------------------------------------
/privateResources/FlyingACETexture.tps:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | fileFormatVersion
5 | 3
6 | texturePackerVersion
7 | 3.6.0
8 | fileName
9 | /home/netbeen/FlyingACE/privateResources/FlyingACETexture.tps
10 | autoSDSettings
11 |
12 |
13 | scale
14 | 1
15 | extension
16 |
17 | spriteFilter
18 |
19 | acceptFractionalValues
20 |
21 | maxTextureSize
22 |
23 | width
24 | -1
25 | height
26 | -1
27 |
28 |
29 |
30 | allowRotation
31 |
32 | premultiplyAlpha
33 |
34 | shapeDebug
35 |
36 | dpi
37 | 72
38 | dataFormat
39 | cocos2d
40 | textureFileName
41 | ../Resources/texture.png
42 | flipPVR
43 |
44 | pvrCompressionQuality
45 | PVR_QUALITY_NORMAL
46 | mipMapMinSize
47 | 32768
48 | etc1CompressionQuality
49 | ETC1_QUALITY_LOW_PERCEPTUAL
50 | dxtCompressionMode
51 | DXT_PERCEPTUAL
52 | jxrColorFormat
53 | JXR_YUV444
54 | jxrTrimFlexBits
55 | 0
56 | jxrCompressionLevel
57 | 0
58 | ditherType
59 | FloydSteinbergAlpha
60 | backgroundColor
61 | 0
62 | libGdx
63 |
64 | filtering
65 |
66 | x
67 | Linear
68 | y
69 | Linear
70 |
71 |
72 | shapePadding
73 | 2
74 | jpgQuality
75 | 80
76 | pngOptimizationLevel
77 | 1
78 | webpQualityLevel
79 | 101
80 | textureSubPath
81 |
82 | textureFormat
83 | png
84 | borderPadding
85 | 2
86 | maxTextureSize
87 |
88 | width
89 | 2048
90 | height
91 | 2048
92 |
93 | fixedTextureSize
94 |
95 | width
96 | -1
97 | height
98 | -1
99 |
100 | reduceBorderArtifacts
101 |
102 | algorithmSettings
103 |
104 | algorithm
105 | MaxRects
106 | freeSizeMode
107 | Best
108 | sizeConstraints
109 | AnySize
110 | forceSquared
111 |
112 | forceWordAligned
113 |
114 | maxRects
115 |
116 | heuristic
117 | Best
118 |
119 | basic
120 |
121 | sortBy
122 | Best
123 | order
124 | Ascending
125 |
126 |
127 | andEngine
128 |
129 | minFilter
130 | Linear
131 | packageName
132 | Texture
133 | wrap
134 |
135 | s
136 | Clamp
137 | t
138 | Clamp
139 |
140 | magFilter
141 | MagLinear
142 |
143 | dataFileNames
144 |
151 | multiPack
152 |
153 | forceIdenticalLayout
154 |
155 | outputFormat
156 | RGBA4444
157 | contentProtection
158 |
159 | key
160 |
161 |
162 | autoAliasEnabled
163 |
164 | trimSpriteNames
165 |
166 | prependSmartFolderName
167 |
168 | cleanTransparentPixels
169 |
170 | globalSpriteSettings
171 |
172 | scale
173 | 1
174 | scaleMode
175 | Smooth
176 | innerPadding
177 | 0
178 | extrude
179 | 0
180 | trimThreshold
181 | 1
182 | trimMode
183 | Trim
184 | heuristicMask
185 |
186 | pivotPoint
187 | Center
188 |
189 | fileList
190 |
191 | img_bg_1.jpg
192 | myPlane.png
193 | enemy1.png
194 | enemy2.png
195 | enemy3.png
196 | enemyBoss.png
197 | explosion01.png
198 | explosion02.png
199 | explosion03.png
200 | explosion04.png
201 | explosion05.png
202 | explosion06.png
203 | explosion07.png
204 | explosion08.png
205 | explosion09.png
206 | bullet1.png
207 | bullet3.png
208 | bullet2.png
209 | bulletUpgrade.png
210 | pauseButton.png
211 | startButton.png
212 | HP.png
213 | HPBottom.png
214 | launchButton.png
215 | launchButtonUnable.png
216 | bigBombGet.png
217 | bigBomb.png
218 | startGameButton.png
219 | restartGameButton.png
220 | img_bg_welcome.jpg
221 | logo.png
222 | bulletLevelUp2.png
223 | bulletLevelUp1.png
224 | getBigBomb1.png
225 | getBigBomb2.png
226 | bossWarning.png
227 | enemyBulletSet.png
228 | enemyBossBroken.png
229 | enemyBossBrokenMore.png
230 | backToMenuButton.png
231 | selectSceneBackground.jpg
232 | selectStartButton.png
233 | blank.png
234 | locked.png
235 | img_bg_2.jpg
236 | img_bg_4.jpg
237 | img_bg_3.jpg
238 | img_bg_5.jpg
239 |
240 | ignoreFileList
241 |
242 | replaceList
243 |
244 | ignoredWarnings
245 |
246 | commonDivisorX
247 | 1
248 | commonDivisorY
249 | 1
250 |
251 |
252 |
--------------------------------------------------------------------------------
/privateResources/HP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/HP.png
--------------------------------------------------------------------------------
/privateResources/HPBottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/HPBottom.png
--------------------------------------------------------------------------------
/privateResources/backToMenuButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/backToMenuButton.png
--------------------------------------------------------------------------------
/privateResources/bigBomb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bigBomb.png
--------------------------------------------------------------------------------
/privateResources/bigBombGet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bigBombGet.png
--------------------------------------------------------------------------------
/privateResources/blank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/blank.png
--------------------------------------------------------------------------------
/privateResources/bossWarning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bossWarning.png
--------------------------------------------------------------------------------
/privateResources/bullet1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bullet1.png
--------------------------------------------------------------------------------
/privateResources/bullet2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bullet2.png
--------------------------------------------------------------------------------
/privateResources/bullet3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bullet3.png
--------------------------------------------------------------------------------
/privateResources/bulletLevelUp1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bulletLevelUp1.png
--------------------------------------------------------------------------------
/privateResources/bulletLevelUp2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bulletLevelUp2.png
--------------------------------------------------------------------------------
/privateResources/bulletUpgrade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/bulletUpgrade.png
--------------------------------------------------------------------------------
/privateResources/enemy1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/enemy1.png
--------------------------------------------------------------------------------
/privateResources/enemy2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/enemy2.png
--------------------------------------------------------------------------------
/privateResources/enemy3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/enemy3.png
--------------------------------------------------------------------------------
/privateResources/enemyBoss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/enemyBoss.png
--------------------------------------------------------------------------------
/privateResources/enemyBossBroken.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/enemyBossBroken.png
--------------------------------------------------------------------------------
/privateResources/enemyBossBrokenMore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/enemyBossBrokenMore.png
--------------------------------------------------------------------------------
/privateResources/enemyBulletSet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/enemyBulletSet.png
--------------------------------------------------------------------------------
/privateResources/explosion01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion01.png
--------------------------------------------------------------------------------
/privateResources/explosion02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion02.png
--------------------------------------------------------------------------------
/privateResources/explosion03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion03.png
--------------------------------------------------------------------------------
/privateResources/explosion04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion04.png
--------------------------------------------------------------------------------
/privateResources/explosion05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion05.png
--------------------------------------------------------------------------------
/privateResources/explosion06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion06.png
--------------------------------------------------------------------------------
/privateResources/explosion07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion07.png
--------------------------------------------------------------------------------
/privateResources/explosion08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion08.png
--------------------------------------------------------------------------------
/privateResources/explosion09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/explosion09.png
--------------------------------------------------------------------------------
/privateResources/getBigBomb1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/getBigBomb1.png
--------------------------------------------------------------------------------
/privateResources/getBigBomb2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/getBigBomb2.png
--------------------------------------------------------------------------------
/privateResources/img_bg_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/img_bg_1.jpg
--------------------------------------------------------------------------------
/privateResources/img_bg_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/img_bg_2.jpg
--------------------------------------------------------------------------------
/privateResources/img_bg_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/img_bg_3.jpg
--------------------------------------------------------------------------------
/privateResources/img_bg_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/img_bg_4.jpg
--------------------------------------------------------------------------------
/privateResources/img_bg_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/img_bg_5.jpg
--------------------------------------------------------------------------------
/privateResources/img_bg_welcome.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/img_bg_welcome.jpg
--------------------------------------------------------------------------------
/privateResources/launchButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/launchButton.png
--------------------------------------------------------------------------------
/privateResources/launchButtonUnable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/launchButtonUnable.png
--------------------------------------------------------------------------------
/privateResources/locked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/locked.png
--------------------------------------------------------------------------------
/privateResources/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/logo.png
--------------------------------------------------------------------------------
/privateResources/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/logo.psd
--------------------------------------------------------------------------------
/privateResources/myPlane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/myPlane.png
--------------------------------------------------------------------------------
/privateResources/myPlane2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/myPlane2.png
--------------------------------------------------------------------------------
/privateResources/pauseButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/pauseButton.png
--------------------------------------------------------------------------------
/privateResources/restartGameButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/restartGameButton.png
--------------------------------------------------------------------------------
/privateResources/selectSceneBackground.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/selectSceneBackground.jpg
--------------------------------------------------------------------------------
/privateResources/selectStartButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/selectStartButton.png
--------------------------------------------------------------------------------
/privateResources/startButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/startButton.png
--------------------------------------------------------------------------------
/privateResources/startGameButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netbeen/flyingACE/b2f62cf640cdfe376c1b36b8cbaf722dd6ff528c/privateResources/startGameButton.png
--------------------------------------------------------------------------------
/proj.android/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | $(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
6 | $(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
7 | $(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)
8 |
9 | LOCAL_MODULE := cocos2dcpp_shared
10 |
11 | LOCAL_MODULE_FILENAME := libcocos2dcpp
12 |
13 | LOCAL_SRC_FILES := hellocpp/main.cpp \
14 | ../../Classes/AppDelegate.cpp \
15 | ../../Classes/GameBackgroundLayer.cpp \
16 | ../../Classes/PlaneLayer.cpp \
17 | ../../Classes/BulletLayer.cpp \
18 | ../../Classes/EnemyLayer.cpp \
19 | ../../Classes/EnemyUserData.cpp \
20 | ../../Classes/BulletUserData.cpp \
21 | ../../Classes/PlaneUserData.cpp \
22 | ../../Classes/ControlLayer.cpp \
23 | ../../Classes/UFOLayer.cpp \
24 | ../../Classes/UFOUserData.cpp \
25 | ../../Classes/GameScene.cpp \
26 | ../../Classes/ResultScene.cpp \
27 | ../../Classes/WelcomeScene.cpp \
28 | ../../Classes/WelcomeButtonLayer.cpp \
29 | ../../Classes/ResultButtonLayer.cpp \
30 | ../../Classes/WelcomeBackgroundLayer.cpp \
31 | ../../Classes/ResultBackgroundLayer.cpp \
32 | ../../Classes/EnemyBulletLayer.cpp \
33 | ../../Classes/SelectScene.cpp \
34 | ../../Classes/SelectButtonLayer.cpp \
35 | ../../Classes/SelectBackgroundLayer.cpp
36 |
37 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
38 |
39 | LOCAL_STATIC_LIBRARIES := cocos2dx_static
40 |
41 | include $(BUILD_SHARED_LIBRARY)
42 |
43 | $(call import-module,.)
44 |
--------------------------------------------------------------------------------