From d03ff0616ab19b527eb9b4d6ff1a077938761018 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 10 Oct 2012 14:50:04 +0800 Subject: [PATCH] issue #1469: Added MoonWarriors sources and made it works on windows. --- samples/MoonWarriors/Classes/AppDelegate.cpp | 83 ++ samples/MoonWarriors/Classes/AppDelegate.h | 45 + .../MoonWarriors/MoonWarriors-html5.js | 69 + .../MoonWarriors/MoonWarriors-native.js | 69 + .../res/Music/bgMusic.mp3.REMOVED.git-id | 1 + .../Music/mainMainMusic.mp3.REMOVED.git-id | 1 + .../MoonWarriors/res/arial-14.GlyphProject | Bin 0 -> 3188 bytes .../MoonWarriors/res/b01.png.REMOVED.git-id | 1 + .../res/explosion.png.REMOVED.git-id | 1 + .../res/loading.png.REMOVED.git-id | 1 + .../Resources/MoonWarriors/src/AboutLayer.js | 47 + .../Resources/MoonWarriors/src/Bullet.js | 62 + .../Resources/MoonWarriors/src/Effect.js | 78 + .../Resources/MoonWarriors/src/Enemy.js | 75 + .../Resources/MoonWarriors/src/Explosion.js | 38 + .../MoonWarriors/src/GameControlMenu.js | 35 + .../MoonWarriors/src/GameController.js | 70 + .../Resources/MoonWarriors/src/GameLayer.js | 315 +++++ .../Resources/MoonWarriors/src/GameOver.js | 83 ++ .../MoonWarriors/src/LevelManager.js | 99 ++ .../Resources/MoonWarriors/src/Resource.js | 89 ++ .../MoonWarriors/src/SettingsLayer.js | 85 ++ .../Resources/MoonWarriors/src/Ship.js | 128 ++ .../Resources/MoonWarriors/src/SysMenu.js | 110 ++ .../MoonWarriors/src/config/EnemyType.js | 56 + .../MoonWarriors/src/config/GameConfig.js | 94 ++ .../MoonWarriors/src/config/Level.js | 49 + .../Resources/jshelper/jsb_constants.js | 475 +++++++ .../Resources/jshelper/jsb_constants_gl.js | 23 + samples/MoonWarriors/proj.android/.classpath | 8 + samples/MoonWarriors/proj.android/.project | 40 + .../proj.android/AndroidManifest.xml | 28 + .../MoonWarriors/proj.android/ant.properties | 1 + samples/MoonWarriors/proj.android/build.xml | 92 ++ .../MoonWarriors/proj.android/build_native.sh | 100 ++ .../MoonWarriors/proj.android/jni/Android.mk | 28 + .../proj.android/jni/Application.mk | 3 + .../proj.android/jni/testjavascript/main.cpp | 45 + .../proj.android/proguard-project.txt | 20 + .../proj.android/project.properties | 13 + .../proj.android/res/values/strings.xml | 4 + .../testjavascript/TestJavascript.java | 39 + samples/MoonWarriors/proj.ios/AppController.h | 17 + .../MoonWarriors/proj.ios/AppController.mm | 119 ++ .../Default-568h@2x.png.REMOVED.git-id | 1 + .../proj.ios/Default@2x.png.REMOVED.git-id | 1 + .../MoonWarriors.xcodeproj/project.pbxproj | 1254 +++++++++++++++++ samples/MoonWarriors/proj.ios/Prefix.pch | 8 + .../proj.ios/RootViewController.h | 33 + .../proj.ios/RootViewController.mm | 73 + samples/MoonWarriors/proj.ios/main.m | 17 + .../proj.win32/MoonWarriors.vcproj | 295 ++++ .../proj.win32/TestJavascript.vcproj.user | 23 + .../proj.win32/TestJavascript.vcxproj | 186 +++ .../proj.win32/TestJavascript.vcxproj.filters | 110 ++ .../proj.win32/TestJavascript.vcxproj.user | 11 + samples/MoonWarriors/proj.win32/main.cpp | 37 + samples/MoonWarriors/proj.win32/main.h | 13 + .../MoonWarriors/proj.win32/res/testjs.ico | Bin 0 -> 47629 bytes samples/MoonWarriors/proj.win32/resource.h | 20 + samples/MoonWarriors/proj.win32/testjs.rc | 86 ++ .../MoonWarriors/MoonWarriors-html5.js | 69 + .../MoonWarriors/MoonWarriors-native.js | 69 + .../res/Music/bgMusic.mp3.REMOVED.git-id | 1 + .../Music/mainMainMusic.mp3.REMOVED.git-id | 1 + .../MoonWarriors/res/arial-14.GlyphProject | Bin 0 -> 3188 bytes .../MoonWarriors/res/b01.png.REMOVED.git-id | 1 + .../res/explosion.png.REMOVED.git-id | 1 + .../res/loading.png.REMOVED.git-id | 1 + .../Resources/MoonWarriors/src/AboutLayer.js | 47 + .../Resources/MoonWarriors/src/Bullet.js | 62 + .../Resources/MoonWarriors/src/Effect.js | 78 + .../Resources/MoonWarriors/src/Enemy.js | 75 + .../Resources/MoonWarriors/src/Explosion.js | 38 + .../MoonWarriors/src/GameControlMenu.js | 35 + .../MoonWarriors/src/GameController.js | 70 + .../Resources/MoonWarriors/src/GameLayer.js | 315 +++++ .../Resources/MoonWarriors/src/GameOver.js | 83 ++ .../MoonWarriors/src/LevelManager.js | 99 ++ .../Resources/MoonWarriors/src/Resource.js | 89 ++ .../MoonWarriors/src/SettingsLayer.js | 85 ++ .../Resources/MoonWarriors/src/Ship.js | 128 ++ .../Resources/MoonWarriors/src/SysMenu.js | 110 ++ .../MoonWarriors/src/config/EnemyType.js | 56 + .../MoonWarriors/src/config/GameConfig.js | 94 ++ .../MoonWarriors/src/config/Level.js | 49 + .../Resources/js/jsb_constants.js | 475 +++++++ .../Resources/js/jsb_constants_gl.js | 23 + 88 files changed, 7161 insertions(+) create mode 100644 samples/MoonWarriors/Classes/AppDelegate.cpp create mode 100644 samples/MoonWarriors/Classes/AppDelegate.h create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-html5.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-native.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/res/Music/bgMusic.mp3.REMOVED.git-id create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/res/Music/mainMainMusic.mp3.REMOVED.git-id create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/res/arial-14.GlyphProject create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/res/b01.png.REMOVED.git-id create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/res/loading.png.REMOVED.git-id create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/AboutLayer.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/Bullet.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/Effect.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/Enemy.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/Explosion.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/GameControlMenu.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/GameController.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/GameLayer.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/GameOver.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/LevelManager.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/Resource.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/SettingsLayer.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/Ship.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/SysMenu.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/config/EnemyType.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/config/GameConfig.js create mode 100644 samples/MoonWarriors/Resources/MoonWarriors/src/config/Level.js create mode 100644 samples/MoonWarriors/Resources/jshelper/jsb_constants.js create mode 100644 samples/MoonWarriors/Resources/jshelper/jsb_constants_gl.js create mode 100644 samples/MoonWarriors/proj.android/.classpath create mode 100644 samples/MoonWarriors/proj.android/.project create mode 100644 samples/MoonWarriors/proj.android/AndroidManifest.xml create mode 100644 samples/MoonWarriors/proj.android/ant.properties create mode 100644 samples/MoonWarriors/proj.android/build.xml create mode 100644 samples/MoonWarriors/proj.android/build_native.sh create mode 100644 samples/MoonWarriors/proj.android/jni/Android.mk create mode 100644 samples/MoonWarriors/proj.android/jni/Application.mk create mode 100644 samples/MoonWarriors/proj.android/jni/testjavascript/main.cpp create mode 100644 samples/MoonWarriors/proj.android/proguard-project.txt create mode 100644 samples/MoonWarriors/proj.android/project.properties create mode 100644 samples/MoonWarriors/proj.android/res/values/strings.xml create mode 100644 samples/MoonWarriors/proj.android/src/org/cocos2dx/testjavascript/TestJavascript.java create mode 100644 samples/MoonWarriors/proj.ios/AppController.h create mode 100644 samples/MoonWarriors/proj.ios/AppController.mm create mode 100644 samples/MoonWarriors/proj.ios/Default-568h@2x.png.REMOVED.git-id create mode 100644 samples/MoonWarriors/proj.ios/Default@2x.png.REMOVED.git-id create mode 100644 samples/MoonWarriors/proj.ios/MoonWarriors.xcodeproj/project.pbxproj create mode 100644 samples/MoonWarriors/proj.ios/Prefix.pch create mode 100644 samples/MoonWarriors/proj.ios/RootViewController.h create mode 100644 samples/MoonWarriors/proj.ios/RootViewController.mm create mode 100644 samples/MoonWarriors/proj.ios/main.m create mode 100644 samples/MoonWarriors/proj.win32/MoonWarriors.vcproj create mode 100644 samples/MoonWarriors/proj.win32/TestJavascript.vcproj.user create mode 100644 samples/MoonWarriors/proj.win32/TestJavascript.vcxproj create mode 100644 samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.filters create mode 100644 samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.user create mode 100644 samples/MoonWarriors/proj.win32/main.cpp create mode 100644 samples/MoonWarriors/proj.win32/main.h create mode 100644 samples/MoonWarriors/proj.win32/res/testjs.ico create mode 100644 samples/MoonWarriors/proj.win32/resource.h create mode 100644 samples/MoonWarriors/proj.win32/testjs.rc create mode 100644 samples/TestJavascript/Resources/MoonWarriors/MoonWarriors-html5.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/MoonWarriors-native.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/res/Music/bgMusic.mp3.REMOVED.git-id create mode 100644 samples/TestJavascript/Resources/MoonWarriors/res/Music/mainMainMusic.mp3.REMOVED.git-id create mode 100644 samples/TestJavascript/Resources/MoonWarriors/res/arial-14.GlyphProject create mode 100644 samples/TestJavascript/Resources/MoonWarriors/res/b01.png.REMOVED.git-id create mode 100644 samples/TestJavascript/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id create mode 100644 samples/TestJavascript/Resources/MoonWarriors/res/loading.png.REMOVED.git-id create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/AboutLayer.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/Bullet.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/Effect.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/Enemy.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/Explosion.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/GameControlMenu.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/GameController.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/GameLayer.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/GameOver.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/LevelManager.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/Resource.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/SettingsLayer.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/Ship.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/SysMenu.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/config/EnemyType.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/config/GameConfig.js create mode 100644 samples/TestJavascript/Resources/MoonWarriors/src/config/Level.js create mode 100644 samples/TestJavascript/Resources/js/jsb_constants.js create mode 100644 samples/TestJavascript/Resources/js/jsb_constants_gl.js diff --git a/samples/MoonWarriors/Classes/AppDelegate.cpp b/samples/MoonWarriors/Classes/AppDelegate.cpp new file mode 100644 index 0000000000..7278015021 --- /dev/null +++ b/samples/MoonWarriors/Classes/AppDelegate.cpp @@ -0,0 +1,83 @@ +#include "AppDelegate.h" + +#include "cocos2d.h" +#include "SimpleAudioEngine.h" +#include "ScriptingCore.h" +#include "generated/cocos2dx.hpp" +#include "cocos2d_specifics.hpp" +#include "js_bindings_chipmunk_manual.hpp" + +USING_NS_CC; +using namespace CocosDenshion; + +AppDelegate::AppDelegate() +{ +} + +AppDelegate::~AppDelegate() +{ + CCScriptEngineManager::sharedManager()->purgeSharedManager(); +} + +bool AppDelegate::applicationDidFinishLaunching() +{ + // initialize director + CCDirector *pDirector = CCDirector::sharedDirector(); + pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); + + // enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices. + // pDirector->enableRetinaDisplay(true); + + // turn on display FPS + pDirector->setDisplayStats(true); + + // set FPS. the default value is 1.0/60 if you don't call this + pDirector->setAnimationInterval(1.0 / 60); + + ScriptingCore* sc = ScriptingCore::getInstance(); + sc->addRegisterCallback(register_all_cocos2dx); + sc->addRegisterCallback(register_cocos2dx_js_extensions); + + sc->start(); + + CCScriptEngineProtocol *pEngine = ScriptingCore::getInstance(); + CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine); + ScriptingCore::getInstance()->runScript("MoonWarriors/MoonWarriors-native.js"); + return true; +} + +void handle_signal(int signal) { + static int internal_state = 0; + ScriptingCore* sc = ScriptingCore::getInstance(); + // should start everything back + CCDirector* director = CCDirector::sharedDirector(); + if (director->getRunningScene()) { + director->popToRootScene(); + } else { + CCPoolManager::sharedPoolManager()->finalize(); + if (internal_state == 0) { + //sc->dumpRoot(NULL, 0, NULL); + sc->start(); + internal_state = 1; + } else { + sc->runScript("hello.js"); + internal_state = 0; + } + } +} + +// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +void AppDelegate::applicationDidEnterBackground() +{ + CCDirector::sharedDirector()->stopAnimation(); + SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->pauseAllEffects(); +} + +// this function will be called when the app is active again +void AppDelegate::applicationWillEnterForeground() +{ + CCDirector::sharedDirector()->startAnimation(); + SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->resumeAllEffects(); +} diff --git a/samples/MoonWarriors/Classes/AppDelegate.h b/samples/MoonWarriors/Classes/AppDelegate.h new file mode 100644 index 0000000000..6bd9363493 --- /dev/null +++ b/samples/MoonWarriors/Classes/AppDelegate.h @@ -0,0 +1,45 @@ +// +// GCTestAppDelegate.h +// GCTest +// +// Created by Rohan Kuruvilla on 06/08/2012. +// Copyright __MyCompanyName__ 2012. All rights reserved. +// + +#ifndef _APP_DELEGATE_H_ +#define _APP_DELEGATE_H_ + +#include "CCApplication.h" +/** + @brief The cocos2d Application. + + The reason for implement as private inheritance is to hide some interface call by CCDirector. + */ +class AppDelegate : private cocos2d::CCApplication +{ +public: + AppDelegate(); + virtual ~AppDelegate(); + + /** + @brief Implement CCDirector and CCScene init code here. + @return true Initialize success, app continue. + @return false Initialize failed, app terminate. + */ + virtual bool applicationDidFinishLaunching(); + + /** + @brief The function be called when the application enter background + @param the pointer of the application + */ + virtual void applicationDidEnterBackground(); + + /** + @brief The function be called when the application enter foreground + @param the pointer of the application + */ + virtual void applicationWillEnterForeground(); +}; + +#endif // _APP_DELEGATE_H_ + diff --git a/samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-html5.js b/samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-html5.js new file mode 100644 index 0000000000..1aee15ae78 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-html5.js @@ -0,0 +1,69 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + http://www.cocos2d-x.org + + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +// boot code needed for cocos2d-html5 +// Not needed by cocos2d + JS bindings + +var MW = MW || {}; + +(function () { + var d = document; + var c = { + menuType:'canvas', //whether to use canvas mode menu or dom menu + COCOS2D_DEBUG:2, //0 to turn debug off, 1 for basic debug, and 2 for full debug + showFPS:true, + frameRate:60, + tag:'gameCanvas', //the dom element to run cocos2d on + engineDir:'libs/cocos2d/', + appFiles:[ + 'MoonWarriors/src/Resource.js', + 'MoonWarriors/src/config/GameConfig.js', + 'MoonWarriors/src/config/EnemyType.js', + 'MoonWarriors/src/config/Level.js', + 'MoonWarriors/src/Effect.js', + 'MoonWarriors/src/Bullet.js', + 'MoonWarriors/src/Enemy.js', + 'MoonWarriors/src/Explosion.js', + 'MoonWarriors/src/Ship.js', + 'MoonWarriors/src/LevelManager.js', + 'MoonWarriors/src/GameController.js', + 'MoonWarriors/src/GameControlMenu.js', + 'MoonWarriors/src/GameLayer.js', + 'MoonWarriors/src/GameOver.js', + 'MoonWarriors/src/AboutLayer.js', + 'MoonWarriors/src/SettingsLayer.js', + 'MoonWarriors/src/SysMenu.js' + ] + }; + window.addEventListener('DOMContentLoaded', function () { + //first load engine file if specified + var s = d.createElement('script'); + s.src = c.engineDir + 'platform/jsloader.js'; + d.body.appendChild(s); + s.c = c; + s.id = 'cocos2d-html5'; + //else if single file specified, load singlefile + }); +})(); diff --git a/samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-native.js b/samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-native.js new file mode 100644 index 0000000000..5d1e42551e --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/MoonWarriors-native.js @@ -0,0 +1,69 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + + http://www.cocos2d-x.org + + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +// boot code needed for cocos2d + JS bindings. +// Not needed by cocos2d-html5 + +require("jshelper/jsb_constants.js"); + +var MW = MW || {}; + +var appFiles = [ + 'MoonWarriors/src/Resource.js', + 'MoonWarriors/src/config/GameConfig.js', + 'MoonWarriors/src/config/EnemyType.js', + 'MoonWarriors/src/config/Level.js', + 'MoonWarriors/src/Effect.js', + 'MoonWarriors/src/Bullet.js', + 'MoonWarriors/src/Enemy.js', + 'MoonWarriors/src/Explosion.js', + 'MoonWarriors/src/Ship.js', + 'MoonWarriors/src/LevelManager.js', + 'MoonWarriors/src/GameControlMenu.js', + 'MoonWarriors/src/GameLayer.js', + 'MoonWarriors/src/GameOver.js', + 'MoonWarriors/src/AboutLayer.js', + 'MoonWarriors/src/SettingsLayer.js', + 'MoonWarriors/src/SysMenu.js' +]; + +cc.dumpConfig(); + +for( var i=0; i < appFiles.length; i++) { + require( appFiles[i] ); +} + +var director = cc.Director.getInstance(); +director.setDisplayStats(true); + +// set FPS. the default value is 1.0/60 if you don't call this +director.setAnimationInterval(1.0 / 60); + +// create a scene. it's an autorelease object +var mainScene = SysMenu.scene(); + +// run +director.runWithScene(mainScene); + diff --git a/samples/MoonWarriors/Resources/MoonWarriors/res/Music/bgMusic.mp3.REMOVED.git-id b/samples/MoonWarriors/Resources/MoonWarriors/res/Music/bgMusic.mp3.REMOVED.git-id new file mode 100644 index 0000000000..d86bcca004 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/res/Music/bgMusic.mp3.REMOVED.git-id @@ -0,0 +1 @@ +59362b16ba4da187e064648be4d0bcb1c09b504d \ No newline at end of file diff --git a/samples/MoonWarriors/Resources/MoonWarriors/res/Music/mainMainMusic.mp3.REMOVED.git-id b/samples/MoonWarriors/Resources/MoonWarriors/res/Music/mainMainMusic.mp3.REMOVED.git-id new file mode 100644 index 0000000000..7a63ad234e --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/res/Music/mainMainMusic.mp3.REMOVED.git-id @@ -0,0 +1 @@ +c0488f23a6a785893f4845b7fadc59ed892ceedc \ No newline at end of file diff --git a/samples/MoonWarriors/Resources/MoonWarriors/res/arial-14.GlyphProject b/samples/MoonWarriors/Resources/MoonWarriors/res/arial-14.GlyphProject new file mode 100644 index 0000000000000000000000000000000000000000..cbac22bf53b6cc81cdace7e013d3125ea209c0e6 GIT binary patch literal 3188 zcmb7G3wTrI8GipiIhRy{aHoJ;O1T%Bq)FRwu@|6-wP|U3Zy_F%)Am4`6LL;yE26(T zZ(~jcZ{P*3&M~J}6q!?}PEov#aZ^N@IvQOz)2uEQXpu)z)iA{k4@HRr8Y6NaY8n)CG4Yt*o5wB#v?aF@o_^?9Zq z9|dyN-2+Yq5@cvtgSCjF8!_mJV;vGOU?Pe2=s_>~a1l1(Vr;}ExD*VR;c{GoAK*${ zg{yH5uEh_r2|vPh_%W`>4Y(1Tu?08bX54~XaT~T`8*axPxD!9Y&+rHy!!GQ=HD*?7Q8l1+t6b9=?TdF+YQ1WtNsE|W?RwITYB9Au)*0pI(WcsKCKFsVweqN@ z7+S1zrP>?U6K0i~h;b?8oH)40`2T=sgJ`2T&3@8peTHhB}R~lVPMDMBT=rB~XCFFE=e1m_P zm5$Mv-Y^8eg)JCY!aQ8Fg~D>f55^Pf`V8Xbv54B+#@UIeiCSHYnX9x|IGT*8k+e^~ zI|JiExN4mn3zewQVbh{hRCWoZmyoNuuhZ%ZRfnM2M=L#eA!!fQJddNLMC zQ)JodbW<_;62P>k&*2!A&xw) zp37q$I)|M!)J%bc908|lWaf0WW+v1Nv~JC8O`oe(%&zZb@=X(Tsaj{(;6@8Yy~WWW z#8ktzWlCV>a9UlPQ{9s3!@=m^_EJ*@Ppy+r2L5u$BWe2SFz({>XFKl3J?O{1xQ~}6 z5L}!zOuakBiq!{dJ6Bnqm=gGKYUSc#J!!~^&_ z9>hbf>3J68#cWPLs>W%~`tdLZPSZ38f;FkZpLVhnkMe-2=>6D<0q5}CXBprmts6XE zSALGW$h9%#43$?bUb3`u*?G&)uezW*P*c02E?D2t*woz8s;mx2)Q-+BZOz(fcTA73 zOBiNyeNS)SMQ%@_*H=_r;&c?KZ%$BgF{dg6xu}ZeQF>G<}N-yq1_$>#q9|t(! zhZ<6*=BOS{bv#?f&Px^6^0^&v@KWx;k%mC9ZdnEM*Enam=9Lt>3yVEIpWmJ1n&&I> z7Q1|YS4klk+#a{DsHDhKT+BUNbvuf;SDx1Q_u(BJ!|yO~x|%0rHE$aaqZ)DDngxR( z-{Y=+&(7zlN*OQ|)o}~YWD7)zr_kr|dp#ZtgtsXDDj5WE0w3~;6bM!)O=WddU804p zpSF_dyB8;LGSxHR>Kal!4-NC@Oxj+b%U|Lu^!u!cg)UzSk6PsQalz&Hy4}S^-V*;1 ze2?R=%wOrw;cw(t>;iJjcp-;6{yVq3a`-!?P5*I!hR?0~{S*IUK~~?7FYqO6U`_wE zegrs3C~N$F!HDqxlq$nCk+?etYyLjd!tG(yCz1B1-&EC2#|-DUF`HHY6)=A)F@ z`Tc1;Ih#x;Zc<2YAe+fe>|6#6XZ$q zG?8ZhL2{V9N!}uFlVjvv@;>>1949BpN%9e0MwinnT1{){ z3L2yhw28LRHoB6As6xY3rJYoxYiT#t={joAB<-PnbOYT;FQu2!E9jN2v8zd6Jwb&zH;PfLt#t za#+4j-X`B6-z)EsACjMxpO#;c_sa+6Bl1!C9r=Cv1Npf8C;628wSzcp4%so*G2T(` z2smmTb&e)S#L?ln(s8w8pW}ezO~&mCW9*|WxFP0Gr#dJ3R4y^`$oI{2NH`yXyb B$+`dl literal 0 HcmV?d00001 diff --git a/samples/MoonWarriors/Resources/MoonWarriors/res/b01.png.REMOVED.git-id b/samples/MoonWarriors/Resources/MoonWarriors/res/b01.png.REMOVED.git-id new file mode 100644 index 0000000000..ab880f0157 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/res/b01.png.REMOVED.git-id @@ -0,0 +1 @@ +46f10a6bf5c63f03ddf8566f392aa7a8f258d7e8 \ No newline at end of file diff --git a/samples/MoonWarriors/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id b/samples/MoonWarriors/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id new file mode 100644 index 0000000000..56b3df641c --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id @@ -0,0 +1 @@ +97bca7d49fb6ec5c330f6ab6f5f49d335601a669 \ No newline at end of file diff --git a/samples/MoonWarriors/Resources/MoonWarriors/res/loading.png.REMOVED.git-id b/samples/MoonWarriors/Resources/MoonWarriors/res/loading.png.REMOVED.git-id new file mode 100644 index 0000000000..a35d4e432f --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/res/loading.png.REMOVED.git-id @@ -0,0 +1 @@ +ca7905a1a07e2be3e02fbf329772c2c361400af7 \ No newline at end of file diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/AboutLayer.js b/samples/MoonWarriors/Resources/MoonWarriors/src/AboutLayer.js new file mode 100644 index 0000000000..4d188d335a --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/AboutLayer.js @@ -0,0 +1,47 @@ +var AboutLayer = cc.Layer.extend({ + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint(cc.p(0,0)); + this.addChild(sp, 0, 1); + + var cacheImage = cc.TextureCache.getInstance().addImage(s_menuTitle); + var title = cc.Sprite.createWithTexture(cacheImage, cc.rect(0, 36, 100, 34)); + title.setPosition(cc.p(winSize.width / 2, winSize.height - 60)); + this.addChild(title); + + // There is a bug in LabelTTF native. Apparently it fails with some unicode chars. +// var about = cc.LabelTTF.create(" This showcase utilizes many features from Cocos2d-html5 engine, including: Parallax background, tilemap, actions, ease, frame animation, schedule, Labels, keyboard Dispatcher, Scene Transition. \n Art and audio is copyrighted by Enigmata Genus Revenge, you may not use any copyrigted material without permission. This showcase is licensed under GPL. \n \n Programmer: \n Shengxiang Chen (陈升想) \n Dingping Lv (吕定平) \n Effects animation: Hao Wu(吴昊)\n Quality Assurance: Sean Lin(林顺)", "Arial", 14, cc.size(winSize.width * 0.85, 100), cc.TEXT_ALIGNMENT_LEFT ); + var about = cc.LabelTTF.create(" This showcase utilizes many features from Cocos2d-html5 engine, including: Parallax background, tilemap, actions, ease, frame animation, schedule, Labels, keyboard Dispatcher, Scene Transition. \n Art and audio is copyrighted by Enigmata Genus Revenge, you may not use any copyrigted material without permission. This showcase is licensed under GPL. \n\nProgrammer: \n Shengxiang Chen\n Dingping Lv \n Effects animation: Hao Wu\n Quality Assurance: Sean Lin", "Arial", 14, cc.size(winSize.width * 0.85, 320), cc.TEXT_ALIGNMENT_LEFT ); + about.setPosition(cc.p(winSize.width / 2, winSize.height/2 -20) ); + about.setAnchorPoint( cc.p(0.5, 0.5)); + this.addChild(about); + + var label = cc.LabelTTF.create("Go back", "Arial", 14); + var back = cc.MenuItemLabel.create(label, this, this.backCallback); + var menu = cc.Menu.create(back); + menu.setPosition(cc.p(winSize.width / 2, 40)); + this.addChild(menu); + bRet = true; + } + + return bRet; + }, + backCallback:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(SysMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + } +}); + +AboutLayer.create = function () { + var sg = new AboutLayer(); + if (sg && sg.init()) { + return sg; + } + return null; +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/Bullet.js b/samples/MoonWarriors/Resources/MoonWarriors/src/Bullet.js new file mode 100644 index 0000000000..d22c3b015a --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/Bullet.js @@ -0,0 +1,62 @@ +//bullet +var Bullet = cc.Sprite.extend({ + active:true, + xVelocity:0, + yVelocity:200, + power:1, + HP:1, + moveType:null, + zOrder:3000, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + parentType:MW.BULLET_TYPE.PLAYER, + ctor:function (bulletSpeed, weaponType, attackMode) { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + this.yVelocity = -bulletSpeed; + this.attackMode = attackMode; + cc.SpriteFrameCache.getInstance().addSpriteFrames(s_bullet_plist); + this.initWithSpriteFrameName(weaponType); + this.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + /*var tmpAction; + switch (this.attackMode) { + case MW.ENEMY_MOVE_TYPE.NORMAL: + tmpAction = cc.MoveBy.create(2, cc.p(this.getPosition().x, 400)); + break; + case MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN: + tmpAction = cc.MoveTo.create(2, GameLayer.create()._ship.getPosition()); + break; + } + this.runAction(tmpAction);*/ + }, + update:function (dt) { + var p = this.getPosition(); + p.x -= this.xVelocity * dt; + p.y -= this.yVelocity * dt; + this.setPosition( p ); + if (this.HP <= 0) { + this.active = false; + } + }, + destroy:function () { + var explode = cc.Sprite.create(s_hit); + explode.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + explode.setPosition(this.getPosition()); + explode.setRotation(Math.random()*360); + explode.setScale(0.75); + this.getParent().addChild(explode,9999); + cc.ArrayRemoveObject(MW.CONTAINER.ENEMY_BULLETS,this); + cc.ArrayRemoveObject(MW.CONTAINER.PLAYER_BULLETS,this); + this.removeFromParentAndCleanup(true); + var removeExplode = cc.CallFunc.create(explode,explode.removeFromParentAndCleanup); + explode.runAction(cc.ScaleBy.create(0.3, 2,2)); + explode.runAction(cc.Sequence.create(cc.FadeOut.create(0.3), removeExplode)); + }, + hurt:function () { + this.HP--; + }, + collideRect:function(){ + var p = this.getPosition(); + return cc.rect(p.x - 3, p.y - 3, 6, 6); + } +}); diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/Effect.js b/samples/MoonWarriors/Resources/MoonWarriors/src/Effect.js new file mode 100644 index 0000000000..faaa03c491 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/Effect.js @@ -0,0 +1,78 @@ +var flareEffect = function (parent, target, callback) { + var flare = cc.Sprite.create(s_flare); + flare.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + parent.addChild(flare, 10); + flare.setOpacity(0); + flare.setPosition(cc.p(-30, 297)); + flare.setRotation(-120); + flare.setScale(0.2); + + var opacityAnim = cc.FadeTo.create(0.5, 255); + var opacDim = cc.FadeTo.create(1, 0); + var biggeAnim = cc.ScaleBy.create(0.7, 1.2, 1.2); + var biggerEase = cc.EaseSineOut.create(biggeAnim); + var moveAnim = cc.MoveBy.create(0.5, cc.p(328, 0)); + var easeMove = cc.EaseSineOut.create(moveAnim); + var rotateAnim = cc.RotateBy.create(2.5, 90); + var rotateEase = cc.EaseExponentialOut.create(rotateAnim); + var bigger = cc.ScaleTo.create(0.5, 1); + + var onComplete = cc.CallFunc.create(target, callback); + var killflare = cc.CallFunc.create(flare, function () { + this.getParent().removeChild(this,true); + }); + flare.runAction(cc.Sequence.create(opacityAnim, biggerEase, opacDim, killflare, onComplete)); + flare.runAction(easeMove); + flare.runAction(rotateEase); + flare.runAction(bigger); +}; + +var removeFromParent = function( sprite ) +{ + sprite.removeFromParentAndCleanup( true ); +}; + +var spark = function (ccpoint, parent, scale, duration) { + scale = scale || 0.3; + duration = duration || 0.5; + + var one = cc.Sprite.create(s_explode1); + var two = cc.Sprite.create(s_explode2); + var three = cc.Sprite.create(s_explode3); + + one.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + two.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + three.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + + one.setPosition(ccpoint); + two.setPosition(ccpoint); + three.setPosition(ccpoint); + + //parent.addChild(one); + parent.addChild(two); + parent.addChild(three); + one.setScale(scale); + two.setScale(scale); + three.setScale(scale); + + three.setRotation(Math.random() * 360); + + var left = cc.RotateBy.create(duration, -45); + var right = cc.RotateBy.create(duration, 45); + var scaleBy = cc.ScaleBy.create(duration, 3, 3); + var fadeOut = cc.FadeOut.create(duration); + var remove = cc.CallFunc.create(this, removeFromParent ); + var seq = cc.Sequence.create( fadeOut, remove ); + + one.runAction(left); + two.runAction(right); + + one.runAction(scaleBy); + two.runAction(scaleBy.copy()); + three.runAction(scaleBy.copy()); + + one.runAction(seq); + two.runAction(seq.copy() ); + three.runAction(seq.copy()); +}; + diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/Enemy.js b/samples/MoonWarriors/Resources/MoonWarriors/src/Enemy.js new file mode 100644 index 0000000000..e266118547 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/Enemy.js @@ -0,0 +1,75 @@ +var Enemy = cc.Sprite.extend({ + eID:0, + active:true, + speed:200, + bulletSpeed:-200, + HP:15, + bulletPowerValue:1, + moveType:null, + scoreValue:200, + zOrder:1000, + delayTime:1 + 1.2 * Math.random(), + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + _hurtColorLife:0, + ctor:function (arg) { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + this.HP = arg.HP; + this.moveType = arg.moveType; + this.scoreValue = arg.scoreValue; + this.attackMode = arg.attackMode; + + this.initWithSpriteFrameName(arg.textureName); + this.schedule(this.shoot, this.delayTime); + }, + _timeTick:0, + update:function (dt) { + if (this.HP <= 0) { + this.active = false; + } + this._timeTick += dt; + if (this._timeTick > 0.1) { + this._timeTick = 0; + if (this._hurtColorLife > 0) { + this._hurtColorLife--; + } + if (this._hurtColorLife == 1) { + this.setColor( cc.WHITE ); + } + } + }, + destroy:function () { + MW.SCORE += this.scoreValue; + var a = new Explosion(); + a.setPosition(this.getPosition()); + this.getParent().addChild(a); + spark(this.getPosition(),this.getParent(), 1.2, 0.7); + cc.ArrayRemoveObject(MW.CONTAINER.ENEMIES,this); + this.removeFromParentAndCleanup(true); + if(MW.SOUND){ + cc.AudioEngine.getInstance().playEffect(s_explodeEffect); + } + }, + shoot:function () { + var p = this.getPosition(); + var b = new Bullet(this.bulletSpeed, "W2.png", this.attackMode); + MW.CONTAINER.ENEMY_BULLETS.push(b); + this.getParent().addChild(b, b.zOrder, MW.UNIT_TAG.ENMEY_BULLET); + b.setPosition(cc.p(p.x, p.y - this.getContentSize().height * 0.2)); + }, + hurt:function () { + this._hurtColorLife = 2; + this.HP--; + this.setColor( cc.RED ); + }, + collideRect:function(){ + var a = this.getContentSize(); + var p = this.getPosition(); + return cc.rect(p.x - a.width/2, p.y - a.height/4,a.width,a.height/2); + } +}); + +Enemy.sharedEnemy = function(){ + cc.SpriteFrameCache.getInstance().addSpriteFrames(s_Enemy_plist, s_Enemy); +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/Explosion.js b/samples/MoonWarriors/Resources/MoonWarriors/src/Explosion.js new file mode 100644 index 0000000000..8ccd225c5d --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/Explosion.js @@ -0,0 +1,38 @@ +var Explosion = cc.Sprite.extend({ + tmpWidth:0, + tmpHeight:0, + ctor:function () { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + var pFrame = cc.SpriteFrameCache.getInstance().getSpriteFrame("explosion_01.png"); + this.initWithSpriteFrame(pFrame); + + var cs = this.getContentSize(); + this.tmpWidth = cs.width; + this.tmpHeight = cs.height; + + var animation = cc.AnimationCache.getInstance().getAnimation("Explosion"); + this.runAction(cc.Sequence.create( + cc.Animate.create(animation), + cc.CallFunc.create(this, this.destroy) + )); + this.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + }, + destroy:function () { + this.getParent().removeChild(this,true); + } +}); + +Explosion.sharedExplosion = function () { + cc.SpriteFrameCache.getInstance().addSpriteFrames(s_explosion_plist); + var animFrames = []; + var str = ""; + for (var i = 1; i < 35; i++) { + str = "explosion_" + (i < 10 ? ("0" + i) : i) + ".png"; + var frame = cc.SpriteFrameCache.getInstance().getSpriteFrame(str); + animFrames.push(frame); + } + var animation = cc.Animation.create(animFrames, 0.04); + cc.AnimationCache.getInstance().addAnimation(animation, "Explosion"); +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/GameControlMenu.js b/samples/MoonWarriors/Resources/MoonWarriors/src/GameControlMenu.js new file mode 100644 index 0000000000..3fcdac736e --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/GameControlMenu.js @@ -0,0 +1,35 @@ +var GameControlMenu = cc.Layer.extend({ + ctor:function() { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Layer); + }, + init:function () { + var bRet = false; + if (this._super()) { + cc.MenuItemFont.setFontSize(18); + cc.MenuItemFont.setFontName("Arial"); + var systemMenu = cc.MenuItemFont.create("Main Menu", this, this.sysMenu); + var menu = cc.Menu.create(systemMenu); + menu.setPosition(cc.p(0, 0)); + systemMenu.setAnchorPoint(cc.p(0, 0)); + systemMenu.setPosition(cc.p(winSize.width-95, 5)); + this.addChild(menu, 1, 2); + bRet = true; + } + + return bRet; + }, + sysMenu:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(SysMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2,scene)); + } +}); + +GameControlMenu.create = function () { + var sg = new GameControlMenu(); + if (sg && sg.init()) { + return sg; + } + return null; +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/GameController.js b/samples/MoonWarriors/Resources/MoonWarriors/src/GameController.js new file mode 100644 index 0000000000..d5aed4be94 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/GameController.js @@ -0,0 +1,70 @@ +/** + * Cocos2d-html5 show case : Moon Warriors + * + * @Licensed: + * This showcase is licensed under GPL. + * + * @Authors: + * Programmer: Shengxiang Chen (陈升想), Dingping Lv (吕定平), Ricardo Quesada + * Effects animation: Hao Wu (吴昊) + * Quality Assurance: Sean Lin (林顺) + * + * @Links: + * http://www.cocos2d-x.org + * http://bbs.html5china.com + * + */ + + +MW.GameController = cc.Class.extend({ + _curScene:null, + _gameState:MW.GAME_STATE.HOME, + _isNewGame:true, + _curLevel:MW.LEVEL.STAGE1, + _selectLevel:MW.LEVEL.STAGE1, + init:function () { + return true; + }, + setCurScene:function (s) { + if (this._curScene != s) { + if (this._curScene !== null) { + this._curScene.onExit(); + } + this._curScene = s; + if (this._curScene) { + this._curScene.onEnter(); + cc.Director.getInstance().replaceScene(s); + } + } + }, + getCurScene:function () { + return this._curScene; + }, + runGame:function () { + + }, + newGame:function () { + + }, + option:function () { + + }, + about:function () { + + } +}); + +MW.GameController.getInstance = function () { + cc.Assert(this._sharedGame, "Havn't call setSharedGame"); + if (!this._sharedGame) { + this._sharedGame = new MW.GameController(); + if (this._sharedGame.init()) { + return this._sharedGame; + } + } else { + return this._sharedGame; + } + return null; +}; + +MW.GameController._sharedGame = null; \ No newline at end of file diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/GameLayer.js b/samples/MoonWarriors/Resources/MoonWarriors/src/GameLayer.js new file mode 100644 index 0000000000..60ee0ba738 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/GameLayer.js @@ -0,0 +1,315 @@ +// +// MoonWarriors +// +// Handles the Game Logic +// + +STATE_PLAYING = 0; +STATE_GAMEOVER = 1; + +var GameLayer = cc.Layer.extend({ + _time:null, + _ship:null, + _backSky:null, + _backSkyHeight:0, + _backSkyRe:null, + _backTileMap:null, + _backTileMapHeight:0, + _backTileMapRe:null, + _levelManager:null, + _tmpScore:0, + _isBackSkyReload:false, + _isBackTileReload:false, + lbScore:null, + screenRect:null, + explosionAnimation:[], + _beginPos:cc.p(0, 0), + _state:STATE_PLAYING, + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + + // reset global values + MW.CONTAINER.ENEMIES = []; + MW.CONTAINER.ENEMY_BULLETS = []; + MW.CONTAINER.PLAYER_BULLETS = []; + MW.SCORE = 0; + MW.LIFE = 4; + this._state = STATE_PLAYING; + + Explosion.sharedExplosion(); + Enemy.sharedEnemy(); + winSize = cc.Director.getInstance().getWinSize(); + this._levelManager = new LevelManager(this); + this.initBackground(); + this.screenRect = cc.rect(0, 0, winSize.width, winSize.height + 10); + + // score + this.lbScore = cc.LabelBMFont.create("Score: 0", s_arial14_fnt); + this.lbScore.setAnchorPoint( cc.p(1,0) ); + this.lbScore.setAlignment( cc.TEXT_ALIGNMENT_RIGHT ); + this.addChild(this.lbScore, 1000); + this.lbScore.setPosition(cc.p(winSize.width - 5 , winSize.height - 30)); + + // ship life + var shipTexture = cc.TextureCache.getInstance().addImage(s_ship01); + var life = cc.Sprite.createWithTexture(shipTexture, cc.rect(0, 0, 60, 38)); + life.setScale(0.6); + life.setPosition(cc.p(30, 460)); + this.addChild(life, 1, 5); + + // ship Life count + this._lbLife = cc.LabelTTF.create("0", "Arial", 20); + this._lbLife.setPosition(cc.p(60, 463)); + this._lbLife.setColor(cc.RED); + this.addChild(this._lbLife, 1000); + + // ship + this._ship = new Ship(); + this.addChild(this._ship, this._ship.zOrder, MW.UNIT_TAG.PLAYER); + + // accept touch now! + + var t = cc.config.deviceType; + if( t == 'browser' ) { + this.setTouchEnabled(true); + this.setKeyboardEnabled(true); + } else if( t == 'desktop' ) { + this.setMouseEnabled(true); + } else if( t == 'mobile' ) { + this.setTouchEnabled(true); + } + + // schedule + this.scheduleUpdate(); + this.schedule(this.scoreCounter, 1); + + if (MW.SOUND) { + cc.AudioEngine.getInstance().playBackgroundMusic(s_bgMusic, true); + } + + bRet = true; + } + return bRet; + }, + scoreCounter:function () { + if( this._state == STATE_PLAYING ) { + this._time++; + + var minute = 0 | (this._time / 60); + var second = this._time % 60; + minute = minute > 9 ? minute : "0" + minute; + second = second > 9 ? second : "0" + second; + var curTime = minute + ":" + second; + this._levelManager.loadLevelResource(this._time); + } + }, + + onTouchesMoved:function (touches, event) { + this.processEvent( touches[0] ); + }, + + onMouseDragged:function( event ) { + this.processEvent( event ); + }, + + processEvent:function( event ) { + if( this._state == STATE_PLAYING ) { + var delta = event.getDelta(); + var curPos = this._ship.getPosition(); + curPos= cc.pAdd( curPos, delta ); + curPos = cc.pClamp(curPos, cc.POINT_ZERO, cc.p(winSize.width, winSize.height) ); + this._ship.setPosition( curPos ); + } + }, + + onKeyDown:function (e) { + MW.KEYS[e] = true; + }, + + onKeyUp:function (e) { + MW.KEYS[e] = false; + }, + + update:function (dt) { + if( this._state == STATE_PLAYING ) { + this.checkIsCollide(); + this.removeInactiveUnit(dt); + this.checkIsReborn(); + this.updateUI(); + } + + if( cc.config.deviceType == 'browser' ) + cc.$("#cou").innerHTML = "Ship:" + 1 + ", Enemy: " + MW.CONTAINER.ENEMIES.length + ", Bullet:" + MW.CONTAINER.ENEMY_BULLETS.length + "," + MW.CONTAINER.PLAYER_BULLETS.length + " all:" + this.getChildren().length; + }, + checkIsCollide:function () { + var selChild, bulletChild; + //check collide + var i =0; + for (i = 0; i < MW.CONTAINER.ENEMIES.length; i++) { + selChild = MW.CONTAINER.ENEMIES[i]; + for (var j = 0; j < MW.CONTAINER.PLAYER_BULLETS.length; j++) { + bulletChild = MW.CONTAINER.PLAYER_BULLETS[j]; + if (this.collide(selChild, bulletChild)) { + bulletChild.hurt(); + selChild.hurt(); + } + if (!cc.rectIntersectsRect(this.screenRect, bulletChild.getBoundingBox() )) { + bulletChild.destroy(); + } + } + if (this.collide(selChild, this._ship)) { + if (this._ship.active) { + selChild.hurt(); + this._ship.hurt(); + } + } + if (!cc.rectIntersectsRect(this.screenRect, selChild.getBoundingBox() )) { + selChild.destroy(); + } + } + + for (i = 0; i < MW.CONTAINER.ENEMY_BULLETS.length; i++) { + selChild = MW.CONTAINER.ENEMY_BULLETS[i]; + if (this.collide(selChild, this._ship)) { + if (this._ship.active) { + selChild.hurt(); + this._ship.hurt(); + } + } + if (!cc.rectIntersectsRect(this.screenRect, selChild.getBoundingBox() )) { + selChild.destroy(); + } + } + }, + removeInactiveUnit:function (dt) { + var selChild, layerChildren = this.getChildren(); + for (var i in layerChildren) { + selChild = layerChildren[i]; + if (selChild) { + if( typeof selChild.update == 'function' ) { + selChild.update(dt); + var tag = selChild.getTag(); + if ((tag == MW.UNIT_TAG.PLAYER) || (tag == MW.UNIT_TAG.PLAYER_BULLET) || + (tag == MW.UNIT_TAG.ENEMY) || (tag == MW.UNIT_TAG.ENMEY_BULLET)) { + if (selChild && !selChild.active) { + selChild.destroy(); + } + } + } + } + } + }, + checkIsReborn:function () { + if (MW.LIFE > 0 && !this._ship.active) { + // ship + this._ship = new Ship(); + this.addChild(this._ship, this._ship.zOrder, MW.UNIT_TAG.PLAYER); + } + else if (MW.LIFE <= 0 && !this._ship.active) { + this._state = STATE_GAMEOVER; + // XXX: needed for JS bindings. + this._ship = null; + this.runAction(cc.Sequence.create( + cc.DelayTime.create(0.2), + cc.CallFunc.create(this, this.onGameOver))); + } + }, + updateUI:function () { + if (this._tmpScore < MW.SCORE) { + this._tmpScore += 5; + } + this._lbLife.setString(MW.LIFE); + this.lbScore.setString("Score: " + this._tmpScore); + }, + collide:function (a, b) { + var aRect = a.collideRect(); + var bRect = b.collideRect(); + if (cc.rectIntersectsRect(aRect, bRect)) { + return true; + } + }, + initBackground:function () { + // bg + this._backSky = cc.Sprite.create(s_bg01); + this._backSky.setAnchorPoint(cc.p(0, 0)); + this._backSkyHeight = this._backSky.getContentSize().height; + this.addChild(this._backSky, -10); + + //tilemap + this._backTileMap = cc.TMXTiledMap.create(s_level01); + this.addChild(this._backTileMap, -9); + this._backTileMapHeight = this._backTileMap.getMapSize().height * this._backTileMap.getTileSize().height; + + this._backSkyHeight -= 48; + this._backTileMapHeight -= 200; + this._backSky.runAction(cc.MoveBy.create(3, cc.p(0, -48))); + this._backTileMap.runAction(cc.MoveBy.create(3, cc.p(0, -200))); + + this.schedule(this.movingBackground, 3); + }, + movingBackground:function () { + this._backSky.runAction(cc.MoveBy.create(3, cc.p(0, -48))); + this._backTileMap.runAction(cc.MoveBy.create(3, cc.p(0, -200))); + this._backSkyHeight -= 48; + this._backTileMapHeight -= 200; + + if (this._backSkyHeight <= winSize.height) { + if (!this._isBackSkyReload) { + this._backSkyRe = cc.Sprite.create(s_bg01); + this._backSkyRe.setAnchorPoint(cc.p(0, 0)); + this.addChild(this._backSkyRe, -10); + this._backSkyRe.setPosition(cc.p(0, winSize.height)); + this._isBackSkyReload = true; + } + this._backSkyRe.runAction(cc.MoveBy.create(3, cc.p(0, -48))); + } + if (this._backSkyHeight <= 0) { + this._backSkyHeight = this._backSky.getContentSize().height; + this.removeChild(this._backSky, true); + this._backSky = this._backSkyRe; + this._backSkyRe = null; + this._isBackSkyReload = false; + } + + if (this._backTileMapHeight <= winSize.height) { + if (!this._isBackTileReload) { + this._backTileMapRe = cc.TMXTiledMap.create(s_level01); + this.addChild(this._backTileMapRe, -9); + this._backTileMapRe.setPosition(cc.p(0, winSize.height)); + this._isBackTileReload = true; + } + this._backTileMapRe.runAction(cc.MoveBy.create(3, cc.p(0, -200))); + } + if (this._backTileMapHeight <= 0) { + this._backTileMapHeight = this._backTileMapRe.getMapSize().height * this._backTileMapRe.getTileSize().height; + this.removeChild(this._backTileMap, true); + this._backTileMap = this._backTileMapRe; + this._backTileMapRe = null; + this._isBackTileReload = false; + } + }, + onGameOver:function () { + var scene = cc.Scene.create(); + scene.addChild(GameOver.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + } +}); + +GameLayer.create = function () { + var sg = new GameLayer(); + if (sg && sg.init()) { + return sg; + } + return null; +}; + +GameLayer.scene = function () { + var scene = cc.Scene.create(); + var layer = GameLayer.create(); + scene.addChild(layer, 1); + return scene; +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/GameOver.js b/samples/MoonWarriors/Resources/MoonWarriors/src/GameOver.js new file mode 100644 index 0000000000..7fcf87c645 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/GameOver.js @@ -0,0 +1,83 @@ +var GameOver = cc.Layer.extend({ + _ship:null, + _lbScore:0, + ctor:function() { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Layer); + }, + init:function () { + var bRet = false; + if (this._super()) { + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint( cc.p(0,0) ); + this.addChild(sp, 0, 1); + + var logo = cc.Sprite.create(s_gameOver); + logo.setAnchorPoint(cc.p(0,0)); + logo.setPosition(cc.p(0,300)); + this.addChild(logo,10,1); + + var playAgainNormal = cc.Sprite.create(s_menu, cc.rect(378, 0, 126, 33)); + var playAgainSelected = cc.Sprite.create(s_menu, cc.rect(378, 33, 126, 33)); + var playAgainDisabled = cc.Sprite.create(s_menu, cc.rect(378, 33 * 2, 126, 33)); + + var cocos2dhtml5 = cc.Sprite.create(s_cocos2dhtml5); + cocos2dhtml5.setPosition(cc.p(160,150)); + this.addChild(cocos2dhtml5,10); + var playAgain = cc.MenuItemSprite.create(playAgainNormal, playAgainSelected, playAgainDisabled, this, function(){ + flareEffect(this,this,this.onPlayAgain); + }); + + var menu = cc.Menu.create(playAgain); + this.addChild(menu, 1, 2); + menu.setPosition(cc.p(winSize.width / 2, 220)); + + var lbScore = cc.LabelTTF.create("Your Score:"+MW.SCORE,"Arial Bold",16); + lbScore.setPosition(cc.p(160,280)); + lbScore.setColor(cc.c3b(250,179,0)); + this.addChild(lbScore,10); + + var b1 = cc.LabelTTF.create("Download Cocos2d-html5","Arial",14); + var b2 = cc.LabelTTF.create("Download This Sample","Arial",14); + var menu1 = cc.MenuItemLabel.create(b1,this,function(){ + window.location.href = "http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-html5"; + }); + var menu2 = cc.MenuItemLabel.create(b2,this,function(){ + window.location.href = "https://github.com/ShengxiangChen/MoonWarriors"; + }); + var cocos2dMenu = cc.Menu.create(menu1,menu2); + cocos2dMenu.alignItemsVerticallyWithPadding(10); + cocos2dMenu.setPosition(cc.p(160,80)); + this.addChild(cocos2dMenu); + + + if(MW.SOUND){ + cc.AudioEngine.getInstance().playBackgroundMusic(s_mainMainMusic); + } + + bRet = true; + } + return bRet; + }, + onPlayAgain:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(GameLayer.create()); + scene.addChild(GameControlMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2,scene)); + } +}); + +GameOver.create = function () { + var sg = new GameOver(); + if (sg && sg.init()) { + return sg; + } + return null; +}; + +GameOver.scene = function () { + var scene = cc.Scene.create(); + var layer = GameOver.create(); + scene.addChild(layer); + return scene; +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/LevelManager.js b/samples/MoonWarriors/Resources/MoonWarriors/src/LevelManager.js new file mode 100644 index 0000000000..6866d7412f --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/LevelManager.js @@ -0,0 +1,99 @@ +var LevelManager = cc.Class.extend({ + _currentLevel:null, + _gameLayer:null, + ctor:function(gameLayer){ + if(!gameLayer){ + throw "gameLayer must be non-nil"; + } + this._currentLevel = Level1; + this._gameLayer = gameLayer; + this.setLevel(this._currentLevel); + }, + + setLevel:function(level){ + for(var i = 0; i< level.enemies.length; i++){ + this._currentLevel.enemies[i].ShowTime = this._minuteToSecond(this._currentLevel.enemies[i].ShowTime); + } + }, + _minuteToSecond:function(minuteStr){ + if(!minuteStr) + return 0; + if(typeof(minuteStr) != "number"){ + var mins = minuteStr.split(':'); + if(mins.length == 1){ + return parseInt(mins[0],10); + }else { + return parseInt(mins[0],10 )* 60 + parseInt(mins[1],10); + } + } + return minuteStr; + }, + + loadLevelResource:function(deltaTime){ + //load enemy + for(var i = 0; i< this._currentLevel.enemies.length; i++){ + var selEnemy = this._currentLevel.enemies[i]; + if(selEnemy){ + if(selEnemy.ShowType == "Once"){ + if(selEnemy.ShowTime == deltaTime){ + for(var tIndex = 0; tIndex < selEnemy.Types.length;tIndex++ ){ + this.addEnemyToGameLayer(selEnemy.Types[tIndex]); + } + } + }else if(selEnemy.ShowType == "Repeate"){ + if(deltaTime % selEnemy.ShowTime === 0){ + for(var rIndex = 0; rIndex < selEnemy.Types.length;rIndex++ ){ + this.addEnemyToGameLayer(selEnemy.Types[rIndex]); + } + } + } + } + } + }, + + addEnemyToGameLayer:function(enemyType){ + var addEnemy = new Enemy(EnemyType[enemyType]); + + var enemypos = cc.p( 80 + (winSize.width - 160) * Math.random(), winSize.height); + var enemycs = addEnemy.getContentSize(); + addEnemy.setPosition( enemypos ); + + + var offset, tmpAction; + var a0=0; + var a1=0; + switch (addEnemy.moveType) { + case MW.ENEMY_MOVE_TYPE.ATTACK: + offset = this._gameLayer._ship.getPosition(); + tmpAction = cc.MoveTo.create(1, offset); + break; + case MW.ENEMY_MOVE_TYPE.VERTICAL: + offset = cc.p(0, -winSize.height - enemycs.height); + tmpAction = cc.MoveBy.create(4, offset); + break; + case MW.ENEMY_MOVE_TYPE.HORIZONTAL: + offset = cc.p(0, -100 - 200 * Math.random()); + a0 = cc.MoveBy.create(0.5, offset); + a1 = cc.MoveBy.create(1, cc.p(-50 - 100 * Math.random(), 0)); + var onComplete = cc.CallFunc.create(addEnemy, function (pSender) { + var a2 = cc.DelayTime.create(1); + var a3 = cc.MoveBy.create(1, cc.p(100 + 100 * Math.random(), 0)); + pSender.runAction(cc.RepeatForever.create( + cc.Sequence.create(a2, a3, a2.copy(), a3.reverse()) + )); + }); + tmpAction = cc.Sequence.create(a0, a1, onComplete); + break; + case MW.ENEMY_MOVE_TYPE.OVERLAP: + var newX = (enemypos.x <= winSize.width / 2) ? 320 : -320; + a0 = cc.MoveBy.create(4, cc.p(newX, -240)); + a1 = cc.MoveBy.create(4,cc.p(-newX,-320)); + tmpAction = cc.Sequence.create(a0,a1); + break; + } + + this._gameLayer.addChild(addEnemy, addEnemy.zOrder, MW.UNIT_TAG.ENEMY); + MW.CONTAINER.ENEMIES.push(addEnemy); + addEnemy.runAction(tmpAction); + } +}); diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/Resource.js b/samples/MoonWarriors/Resources/MoonWarriors/src/Resource.js new file mode 100644 index 0000000000..c2f6becdad --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/Resource.js @@ -0,0 +1,89 @@ +var dirImg = ""; +var dirMusic = ""; +var musicSuffix = ".mp3"; +if( cc.config.deviceType == 'browser' || cc.config.engine == 'cocos2d-x') { + dirImg = "MoonWarriors/res/"; + dirMusic = "MoonWarriors/res/Music/"; + musicSuffix = ""; +} + +//image +var s_bg01 = dirImg + "bg01.jpg"; +var s_loading = dirImg + "loading.png"; +var s_ship01 = dirImg + "ship01.png"; +var s_menu = dirImg + "menu.png"; +var s_logo = dirImg + "logo.png"; +var s_cocos2dhtml5 = dirImg + "cocos2d-html5.png"; +var s_gameOver = dirImg + "gameOver.png"; +var s_menuTitle = dirImg + "menuTitle.png"; +var s_Enemy = dirImg + "Enemy.png"; +var s_flare = dirImg + "flare.jpg"; +var s_bullet = dirImg + "bullet.png"; +var s_explosion = dirImg + "explosion.png"; +var s_explode1 = dirImg + "explode1.jpg"; +var s_explode2= dirImg + "explode2.jpg"; +var s_explode3 = dirImg + "explode3.jpg"; +var s_hit = dirImg + "hit.jpg"; +var s_arial14 = dirImg + "arial-14.png"; +var s_arial14_fnt = dirImg + "arial-14.fnt"; + +//music +var s_bgMusic = dirMusic + "bgMusic" + musicSuffix; +var s_mainMainMusic = dirMusic + "mainMainMusic" + musicSuffix; + +//effect +var s_buttonEffect = dirMusic + "buttonEffet" + musicSuffix; +var s_explodeEffect = dirMusic + "explodeEffect" + musicSuffix; +var s_fireEffect = dirMusic + "fireEffect" + musicSuffix; +var s_shipDestroyEffect = dirMusic + "shipDestroyEffect" + musicSuffix; + +//tmx +var s_level01 = dirImg + "level01.tmx"; + +//plist +var s_Enemy_plist = dirImg + "Enemy.plist"; +var s_explosion_plist = dirImg + "explosion.plist"; +var s_bullet_plist = dirImg + "bullet.plist"; + +var g_ressources = [ + //image + {type:"image", src:s_bg01}, + {type:"image", src:s_loading}, + {type:"image", src:s_ship01}, + {type:"image", src:s_menu}, + {type:"image", src:s_logo}, + {type:"image", src:s_cocos2dhtml5}, + {type:"image", src:s_gameOver}, + {type:"image", src:s_menuTitle}, + {type:"image", src:s_Enemy}, + {type:"image", src:s_flare}, + {type:"image", src:s_bullet}, + {type:"image", src:s_explosion}, + {type:"image", src:s_explode1}, + {type:"image", src:s_explode2}, + {type:"image", src:s_explode3}, + {type:"image", src:s_hit}, + {type:"image", src:s_arial14}, + + //tmx + {type:"tmx", src:s_level01}, + + //plist + {type:"plist", src:s_Enemy_plist}, + {type:"plist", src:s_explosion_plist}, + {type:"plist", src:s_bullet_plist}, + + //music + {type:"bgm", src:s_bgMusic}, + {type:"bgm", src:s_mainMainMusic}, + + //effect + {type:"effect", src:s_buttonEffect}, + {type:"effect", src:s_explodeEffect}, + {type:"effect", src:s_fireEffect}, + {type:"effect", src:s_shipDestroyEffect}, + + // FNT + {type:"fnt", src:s_arial14_fnt} + +]; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/SettingsLayer.js b/samples/MoonWarriors/Resources/MoonWarriors/src/SettingsLayer.js new file mode 100644 index 0000000000..4f8b545311 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/SettingsLayer.js @@ -0,0 +1,85 @@ +var SettingsLayer = cc.Layer.extend({ + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint(cc.p(0,0)); + this.addChild(sp, 0, 1); + + var cacheImage = cc.TextureCache.getInstance().addImage(s_menuTitle); + var title = cc.Sprite.createWithTexture(cacheImage, cc.rect(0, 0, 134, 34)); + title.setPosition(cc.p(winSize.width / 2, winSize.height - 120)); + this.addChild(title); + + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(18); + var title1 = cc.MenuItemFont.create("Sound"); + title1.setEnabled(false); + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(26); + var item1 = cc.MenuItemToggle.create( + cc.MenuItemFont.create("On"), + cc.MenuItemFont.create("Off") ); + item1.setCallback(this, this.soundControl ); + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(18); + var title2 = cc.MenuItemFont.create("Mode"); + title2.setEnabled(false); + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(26); + var item2 = cc.MenuItemToggle.create( + cc.MenuItemFont.create("Easy"), + cc.MenuItemFont.create("Normal"), + cc.MenuItemFont.create("Hard")); + item2.setCallback( this, this.modeControl ); + + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(26); + var label = cc.LabelTTF.create("Go back", "Arial", 20); + var back = cc.MenuItemLabel.create(label, this, this.backCallback); + back.setScale(0.8); + + var menu = cc.Menu.create(title1, title2, item1, item2, back); + menu.alignItemsInColumns(2, 2, 1); + this.addChild(menu); + + var cp_back = back.getPosition(); + cp_back.y -= 50.0; + back.setPosition(cp_back); + + + bRet = true; + } + + return bRet; + }, + backCallback:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(SysMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + soundControl:function(){ + MW.SOUND = MW.SOUND ? false : true; + if(!MW.SOUND){ + cc.AudioEngine.getInstance().stopBackgroundMusic(); + } + }, + modeControl:function(){ + } +}); + +SettingsLayer.create = function () { + var sg = new SettingsLayer(); + if (sg && sg.init()) { + return sg; + } + return null; +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/Ship.js b/samples/MoonWarriors/Resources/MoonWarriors/src/Ship.js new file mode 100644 index 0000000000..84aa6342db --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/Ship.js @@ -0,0 +1,128 @@ +var Ship = cc.Sprite.extend({ + speed:220, + bulletSpeed:900, + HP:5, + bulletTypeValue:1, + bulletPowerValue:1, + throwBombing:false, + canBeAttack:true, + isThrowingBomb:false, + zOrder:3000, + maxBulletPowerValue:4, + appearPosition:cc.p(160, 60), + _hurtColorLife:0, + active:true, + ctor:function () { + + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + //init life + var shipTexture = cc.TextureCache.getInstance().addImage(s_ship01); + this.initWithTexture(shipTexture, cc.rect(0, 0, 60, 38)); + this.setTag(this.zOrder); + this.setPosition(this.appearPosition); + + // set frame + var frame0 = cc.SpriteFrame.createWithTexture(shipTexture, cc.rect(0, 0, 60, 38)); + var frame1 = cc.SpriteFrame.createWithTexture(shipTexture, cc.rect(60, 0, 60, 38)); + + var animFrames = []; + animFrames.push(frame0); + animFrames.push(frame1); + + // ship animate + var animation = cc.Animation.create(animFrames, 0.1); + var animate = cc.Animate.create(animation); + this.runAction(cc.RepeatForever.create(animate)); + this.schedule(this.shoot, 1 / 6); + + //revive effect + this.canBeAttack = false; + var ghostSprite = cc.Sprite.createWithTexture(shipTexture, cc.rect(0, 45, 60, 38)); + ghostSprite.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + ghostSprite.setScale(8); + ghostSprite.setPosition(cc.p(this.getContentSize().width / 2, 12)); + this.addChild(ghostSprite, 3000, 99999); + ghostSprite.runAction(cc.ScaleTo.create(0.5, 1, 1)); + var blinks = cc.Blink.create(3, 9); + var makeBeAttack = cc.CallFunc.create(this, function (t) { + t.canBeAttack = true; + t.setVisible(true); + t.removeChild(ghostSprite,true); + }); + this.runAction(cc.Sequence.create(cc.DelayTime.create(0.5), blinks, makeBeAttack)); + }, + update:function (dt) { + + // Keys are only enabled on the browser + if( cc.config.deviceType == 'browser' ) { + var pos = this.getPosition(); + if ((MW.KEYS[cc.KEY.w] || MW.KEYS[cc.KEY.up]) && pos.y <= winSize.height) { + pos.y += dt * this.speed; + } + if ((MW.KEYS[cc.KEY.s] || MW.KEYS[cc.KEY.down]) && pos.y >= 0) { + pos.y -= dt * this.speed; + } + if ((MW.KEYS[cc.KEY.a] || MW.KEYS[cc.KEY.left]) && pos.x >= 0) { + pos.x -= dt * this.speed; + } + if ((MW.KEYS[cc.KEY.d] || MW.KEYS[cc.KEY.right]) && pos.x <= winSize.width) { + pos.x += dt * this.speed; + } + this.setPosition( pos ); + } + + if (this.HP <= 0) { + this.active = false; + } + this._timeTick += dt; + if (this._timeTick > 0.1) { + this._timeTick = 0; + if (this._hurtColorLife > 0) { + this._hurtColorLife--; + } + if (this._hurtColorLife == 1) { + this.setColor(cc.WHITE); + } + } + }, + shoot:function (dt) { + //this.shootEffect(); + var offset = 13; + var p = this.getPosition(); + var cs = this.getContentSize(); + var a = new Bullet(this.bulletSpeed, "W1.png", MW.ENEMY_MOVE_TYPE.NORMAL); + MW.CONTAINER.PLAYER_BULLETS.push(a); + this.getParent().addChild(a, a.zOrder, MW.UNIT_TAG.PLAYER_BULLET); + a.setPosition(cc.p(p.x + offset, p.y + 3 + cs.height * 0.3)); + + var b = new Bullet(this.bulletSpeed, "W1.png", MW.ENEMY_MOVE_TYPE.NORMAL); + MW.CONTAINER.PLAYER_BULLETS.push(b); + this.getParent().addChild(b, b.zOrder, MW.UNIT_TAG.PLAYER_BULLET); + b.setPosition(cc.p(p.x - offset, p.y + 3 + cs.height * 0.3)); + }, + destroy:function () { + MW.LIFE--; + var p = this.getPosition(); + var myParent = this.getParent(); + myParent.addChild( new Explosion(p) ); + myParent.removeChild(this,true); + if (MW.SOUND) { + cc.AudioEngine.getInstance().playEffect(s_shipDestroyEffect); + } + }, + hurt:function () { + if (this.canBeAttack) { + this._hurtColorLife = 2; + this.HP--; + this.setColor(cc.RED); + } + }, + collideRect:function(){ + var p = this.getPosition(); + var a = this.getContentSize(); + var r = new cc.rect(p.x - a.width/2, p.y - a.height/2, a.width, a.height/2); + return r; + } +}); diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/SysMenu.js b/samples/MoonWarriors/Resources/MoonWarriors/src/SysMenu.js new file mode 100644 index 0000000000..a265636363 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/SysMenu.js @@ -0,0 +1,110 @@ +cc.dumpConfig(); + +var SysMenu = cc.Layer.extend({ + _ship:null, + + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + winSize = cc.Director.getInstance().getWinSize(); + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint(cc.p(0,0)); + this.addChild(sp, 0, 1); + + var logo = cc.Sprite.create(s_logo); + logo.setAnchorPoint(cc.p(0, 0)); + logo.setPosition(cc.p(0, 250)); + this.addChild(logo, 10, 1); + + var newGameNormal = cc.Sprite.create(s_menu, cc.rect(0, 0, 126, 33)); + var newGameSelected = cc.Sprite.create(s_menu, cc.rect(0, 33, 126, 33)); + var newGameDisabled = cc.Sprite.create(s_menu, cc.rect(0, 33 * 2, 126, 33)); + + var gameSettingsNormal = cc.Sprite.create(s_menu, cc.rect(126, 0, 126, 33)); + var gameSettingsSelected = cc.Sprite.create(s_menu, cc.rect(126, 33, 126, 33)); + var gameSettingsDisabled = cc.Sprite.create(s_menu, cc.rect(126, 33 * 2, 126, 33)); + + var aboutNormal = cc.Sprite.create(s_menu, cc.rect(252, 0, 126, 33)); + var aboutSelected = cc.Sprite.create(s_menu, cc.rect(252, 33, 126, 33)); + var aboutDisabled = cc.Sprite.create(s_menu, cc.rect(252, 33 * 2, 126, 33)); + + var newGame = cc.MenuItemSprite.create(newGameNormal, newGameSelected, newGameDisabled, this, function () { + this.onButtonEffect(); + flareEffect(this, this, this.onNewGame); + }); + var gameSettings = cc.MenuItemSprite.create(gameSettingsNormal, gameSettingsSelected, gameSettingsDisabled, this, this.onSettings); + var about = cc.MenuItemSprite.create(aboutNormal, aboutSelected, aboutDisabled, this, this.onAbout); + + var menu = cc.Menu.create(newGame, gameSettings, about); + menu.alignItemsVerticallyWithPadding(10); + this.addChild(menu, 1, 2); + menu.setPosition(cc.p(winSize.width / 2, winSize.height / 2 - 80)); + this.schedule(this.update, 0.1); + + var tmp = cc.TextureCache.getInstance().addImage(s_ship01); + this._ship = cc.Sprite.createWithTexture(tmp,cc.rect(0, 45, 60, 38)); + this.addChild(this._ship, 0, 4); + var pos = cc.p(Math.random() * winSize.width, 0); + this._ship.setPosition( pos ); + this._ship.runAction(cc.MoveBy.create(2, cc.p(Math.random() * winSize.width, pos.y + winSize.height + 100))); + + if (MW.SOUND) { + cc.AudioEngine.getInstance().setBackgroundMusicVolume(0.7); + cc.AudioEngine.getInstance().playBackgroundMusic(s_mainMainMusic, true); + } + + bRet = true; + } + return bRet; + }, + onNewGame:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(GameLayer.create()); + scene.addChild(GameControlMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + onSettings:function (pSender) { + this.onButtonEffect(); + var scene = cc.Scene.create(); + scene.addChild(SettingsLayer.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + onAbout:function (pSender) { + this.onButtonEffect(); + var scene = cc.Scene.create(); + scene.addChild(AboutLayer.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + update:function () { + if (this._ship.getPosition().y > 480) { + var pos = cc.p(Math.random() * winSize.width, 10); + this._ship.setPosition( pos ); + this._ship.runAction( cc.MoveBy.create( + parseInt(5 * Math.random(), 10), + cc.p(Math.random() * winSize.width, pos.y + 480))); + } + }, + onButtonEffect:function(){ + if (MW.SOUND) { + var s = cc.AudioEngine.getInstance().playEffect(s_buttonEffect); + } + } +}); + +SysMenu.create = function () { + var sg = new SysMenu(); + if (sg && sg.init()) { + return sg; + } + return null; +}; + +SysMenu.scene = function () { + var scene = cc.Scene.create(); + var layer = SysMenu.create(); + scene.addChild(layer); + return scene; +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/config/EnemyType.js b/samples/MoonWarriors/Resources/MoonWarriors/src/config/EnemyType.js new file mode 100644 index 0000000000..c947d58903 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/config/EnemyType.js @@ -0,0 +1,56 @@ +var EnemyType = [ + { + type:0, + textureName:"E0.png", + bulletType:"W2.png", + HP:1, + moveType:MW.ENEMY_MOVE_TYPE.ATTACK, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:15 + }, + { + type:1, + textureName:"E1.png", + bulletType:"W2.png", + HP:2, + moveType:MW.ENEMY_MOVE_TYPE.ATTACK, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:40 + }, + { + type:2, + textureName:"E2.png", + bulletType:"W2.png", + HP:4, + moveType:MW.ENEMY_MOVE_TYPE.HORIZONTAL, + attackMode:MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN, + scoreValue:60 + }, + { + type:3, + textureName:"E3.png", + bulletType:"W2.png", + HP:6, + moveType:MW.ENEMY_MOVE_TYPE.OVERLAP, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:80 + }, + { + type:4, + textureName:"E4.png", + bulletType:"W2.png", + HP:10, + moveType:MW.ENEMY_MOVE_TYPE.HORIZONTAL, + attackMode:MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN, + scoreValue:150 + }, + { + type:5, + textureName:"E5.png", + bulletType:"W2.png", + HP:15, + moveType:MW.ENEMY_MOVE_TYPE.HORIZONTAL, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:200 + } +]; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/config/GameConfig.js b/samples/MoonWarriors/Resources/MoonWarriors/src/config/GameConfig.js new file mode 100644 index 0000000000..554d322aa1 --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/config/GameConfig.js @@ -0,0 +1,94 @@ +/** + * Cocos2d-html5 show case : Moon Warriors + * + * @Licensed: + * This showcase is licensed under GPL. + * + * @Authors: + * Programmer: Shengxiang Chen (陈升想), Dingping Lv (吕定平), Ricardo Quesada + * Effects animation: Hao Wu (吴昊) + * Quality Assurance: Sean Lin (林顺) + * + * @Links: + * http://www.cocos2d-x.org + * http://bbs.html5china.com + * + */ + +//game state +MW.GAME_STATE = { + HOME:0, + PLAY:1, + OVER:2 +}; + +//keys +MW.KEYS = []; + +//level +MW.LEVEL = { + STAGE1:1, + STAGE2:2, + STAGE3:3 +}; + +//life +MW.LIFE = 4; + +//score +MW.SCORE = 0; + +//sound +MW.SOUND = true; + +//enemy move type +MW.ENEMY_MOVE_TYPE = { + ATTACK:0, + VERTICAL:1, + HORIZONTAL:2, + OVERLAP:3 +}; + +//delta x +MW.DELTA_X = -100; + +//offset x +MW.OFFSET_X = -24; + +//rot +MW.ROT = -5.625; + +//bullet type +MW.BULLET_TYPE = { + PLAYER:1, + ENEMY:2 +}; + +//weapon type +MW.WEAPON_TYPE = { + ONE:1 +}; + +//unit tag +MW.UNIT_TAG = { + ENMEY_BULLET:900, + PLAYER_BULLET:901, + ENEMY:1000, + PLAYER:1000 +}; + +//attack mode +MW.ENEMY_ATTACK_MODE = { + NORMAL:1, + TSUIHIKIDAN:2 +}; + +//life up sorce +MW.LIFEUP_SORCE = [50000, 100000, 150000, 200000, 250000, 300000]; + +//container +MW.CONTAINER = { + ENEMIES:[], + ENEMY_BULLETS:[], + PLAYER_BULLETS:[] +}; diff --git a/samples/MoonWarriors/Resources/MoonWarriors/src/config/Level.js b/samples/MoonWarriors/Resources/MoonWarriors/src/config/Level.js new file mode 100644 index 0000000000..321a7a270f --- /dev/null +++ b/samples/MoonWarriors/Resources/MoonWarriors/src/config/Level.js @@ -0,0 +1,49 @@ +var Level1 = { + enemies:[ + { + ShowType:"Repeate", + ShowTime:"00:02", + Types:[0,1,2] + }, + { + ShowType:"Repeate", + ShowTime:"00:05", + Types:[3,4,5] + } + /*{ + ShowType:"Repeate", + ShowTime:"00:08", + Types:[0,4,3,5] + }, + { + ShowType:"Once", + ShowTime:"00:6", + Types:[0,2,4,3] + }, + { + ShowType:"Once", + ShowTime:"00:16", + Types:[0,2,5,4,3] + }, + { + ShowType:"Once", + ShowTime:"00:25", + Types:[0,3,5,4,3] + }, + { + ShowType:"Once", + ShowTime:"00:35", + Types:[4,5,3,1,3] + }, + { + ShowType:"Once", + ShowTime:"00:50", + Types:[0,3,2,1,0,3] + }, + { + ShowType:"Once", + ShowTime:"01:15", + Types:[4,5,2,1,0] + }*/ + ] +}; diff --git a/samples/MoonWarriors/Resources/jshelper/jsb_constants.js b/samples/MoonWarriors/Resources/jshelper/jsb_constants.js new file mode 100644 index 0000000000..7ad903713a --- /dev/null +++ b/samples/MoonWarriors/Resources/jshelper/jsb_constants.js @@ -0,0 +1,475 @@ +require('jshelper/jsb_constants_gl.js'); +// cocos2d Helper + +cc.c3 = cc.c3 || function (r, g, b) { + return {r: r, g: g, b: b}; +}; + +cc.c3b = cc.c3; + +cc.c4 = cc.c4 || function (r, g, b, o) { + return {r: r, g: g, b: b, a: o}; +}; + +cc.c4b = cc.c4; + +cc.c4f = cc.c4f || function (r, g, b, o) { + return {r: r, g: g, b: b, a: o}; +}; + +cc.p = cc.p || function( x, y ) +{ + return {x:x, y:y}; +}; + +cc.g = cc.g || cc.p; +cc.log = cc.log || log; + +// +// cocos2d constants +// +cc.TEXTURE_PIXELFORMAT_RGBA8888 = 0; +cc.TEXTURE_PIXELFORMAT_RGB888 = 1; +cc.TEXTURE_PIXELFORMAT_RGB565 = 2; +cc.TEXTURE_PIXELFORMAT_A8 = 3; +cc.TEXTURE_PIXELFORMAT_I8 = 4; +cc.TEXTURE_PIXELFORMAT_AI88 = 5; +cc.TEXTURE_PIXELFORMAT_RGBA4444 = 6; +cc.TEXTURE_PIXELFORMAT_RGB5A1 = 7; +cc.TEXTURE_PIXELFORMAT_PVRTC4 = 8; +cc.TEXTURE_PIXELFORMAT_PVRTC4 = 9; +cc.TEXTURE_PIXELFORMAT_DEFAULT = cc.TEXTURE_PIXELFORMAT_RGBA8888; + +cc.TEXT_ALIGNMENT_LEFT = 0; +cc.TEXT_ALIGNMENT_CENTER = 1; +cc.TEXT_ALIGNMENT_RIGHT = 2; + +cc.VERTICAL_TEXT_ALIGNMENT_TOP = 0; +cc.VERTICAL_TEXT_ALIGNMENT_CENTER = 1; +cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM = 2; + +cc.IMAGE_FORMAT_JPEG = 0; +cc.IMAGE_FORMAT_PNG = 0; + +cc.PROGRESS_TIMER_TYPE_RADIAL = 0; +cc.PROGRESS_TIMER_TYPE_BAR = 1; + +cc.PARTICLE_TYPE_FREE = 0; +cc.PARTICLE_TYPE_RELATIVE = 1; +cc.PARTICLE_TYPE_GROUPED = 2; +cc.PARTICLE_DURATION_INFINITY = -1; +cc.PARTICLE_MODE_GRAVITY = 0; +cc.PARTICLE_MODE_RADIUS = 1; +cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE = -1; +cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS = -1; + +cc.RED = cc.c3(255,0,0); +cc.GREEN = cc.c3(0,255,0); +cc.BLUE = cc.c3(0,0,255); +cc.BLACK = cc.c3(0,0,0); +cc.WHITE = cc.c3(255,255,255); + +cc.POINT_ZERO = {x:0, y:0}; + +cc._reuse_p0 = {x:0, y:0}; +cc._reuse_p1 = {x:0, y:0}; +cc._reuse_p_index = 0; +cc._reuse_color3b = cc.c3(255, 255, 255 ); +cc._reuse_color4b = cc.c4(255, 255, 255, 255 ); +cc._reuse_grid = cc.g(0,0); + +// dump config info, but only in debug mode +cc.dumpConfig = function() +{ + if( cc.config.debug ) { + for(var i in cc.config) + cc.log( i + " = " + cc.config[i] ); + } +}; + +// +// Point +// +cc._p = function( x, y ) +{ + if( cc._reuse_p_index === 0 ) { + cc._reuse_p0.x = x; + cc._reuse_p0.y = y; + cc._reuse_p_index = 1; + return cc._reuse_p0; + } else { + cc._reuse_p1.x = x; + cc._reuse_p1.y = y; + cc._reuse_p_index = 0; + return cc._reuse_p1; + } +}; + +cc._to_p = function( point ) +{ + return point; +}; + +cc._from_p = function( size ) +{ + return size; +}; + +// +// Grid +// +cc._g = function( x, y ) +{ + cc._reuse_grid.x = x; + cc._reuse_grid.y = y; + return cc._reuse_grid; +} + +// +// Color +// +// +// Color 3B +// +cc.c3b = function( r, g, b ) +{ + return {r:r, g:g, b:b }; +}; +cc._c3b = function( r, g, b ) +{ + cc._reuse_color3b.r = r; + cc._reuse_color3b.g = g; + cc._reuse_color3b.b = b; + return cc._reuse_color3b; +}; +// compatibility +cc.c3 = cc.c3b; +cc._c3 = cc._c3b; + +// +// Color 4B +// +cc.c4b = function( r, g, b, a ) +{ + return {r:r, g:g, b:b, a:a }; +}; +cc._c4b = function( r, g, b, a ) +{ + cc._reuse_color4b.r = r; + cc._reuse_color4b.g = g; + cc._reuse_color4b.b = b; + cc._reuse_color4b.a = a; + return cc._reuse_color4b; +}; +// compatibility +cc.c4 = cc.c4b; +cc._c4 = cc._c4b; + + +// +// Size +// +cc.size = function(w,h) +{ + return {width:w, height:h}; +} + +cc._to_size = function( size ) +{ + return size; +} + +cc._from_size = function( size ) +{ + return size; +} + +// +// Rect +// +cc.rect = function(x,y,w,h) +{ + return {x:x, y:y, width:w, height:h}; +} + +cc._to_rect = function( rect ) +{ + return rect; +} + +cc._from_rect = function( rect ) +{ + return rect; +} + +// XXX Should be done in native +cc.rectIntersectsRect = function( rectA, rectB ) +{ + var bool = ! ( rectA.x > rectB.x + rectB.width || + rectA.x + rectA.width < rectB.x || + rectA.y > rectB.y +rectB.height || + rectA.y + rectA.height < rectB.y ); + + return bool; +} + +// point functions +cc.pAdd = cc.pAdd || function (p1, p2) { + return {x: p1.x + p2.x, y: p1.y + p2.y}; +}; + +cc.pSub = cc.pSub || function (p1, p2) { + return {x: p1.x - p2.x, y: p1.y - p2.y}; +} + +cc.pMult = cc.pMult || function (p1, s) { + return {x: p1.x * s, y: p1.y * s}; +}; + +/** + * Calculates dot product of two points. + * @param {cc.Point} v1 + * @param {cc.Point} v2 + * @return {Number} + */ +cc.pDot = function (v1, v2) { + return v1.x * v2.x + v1.y * v2.y; +}; + +/** + * Calculates the square length of a cc.Point (not calling sqrt() ) + * @param {cc.Point} v + *@return {cc.pDot} + */ +cc.pLengthSQ = function (v) { + return cc.pDot(v, v); +}; + +/** + * Calculates distance between point an origin + * @param {cc.Point} v + * @return {Number} + */ +cc.pLength = function (v) { + return Math.sqrt(cc.pLengthSQ(v)); +}; + +/** + * Calculates the distance between two points + * @param {cc.Point} v1 + * @param {cc.Point} v2 + * @return {cc.pLength} + */ +cc.pDistance = function (v1, v2) { + return cc.pLength(cc.pSub(v1, v2)); +}; + +/** + * Clamp a value between from and to. + * @param {Number} value + * @param {Number} min_inclusive + * @param {Number} max_inclusive + * @return {Number} + */ +cc.clampf = function (value, min_inclusive, max_inclusive) { + if (min_inclusive > max_inclusive) { + var temp = min_inclusive; + min_inclusive = max_inclusive; + max_inclusive = temp; + } + return value < min_inclusive ? min_inclusive : value < max_inclusive ? value : max_inclusive; +}; + +/** + * Clamp a point between from and to. + * @param {Number} p + * @param {Number} min_inclusive + * @param {Number} max_inclusive + * @return {cc.Point} + */ +cc.pClamp = function (p, min_inclusive, max_inclusive) { + return cc.p(cc.clampf(p.x, min_inclusive.x, max_inclusive.x), cc.clampf(p.y, min_inclusive.y, max_inclusive.y)); +}; + +/** + * returns a random float between 0 and 1 + * @return {Number} + * @function + */ +cc.RANDOM_0_1 = function () { + return Math.random(); +}; + +/** + * Associates a base class with a native superclass + * @function + * @param {object} jsobj subclass + * @param {object} klass superclass + */ +cc.associateWithNative = function( jsobj, superclass ) { + var native = new superclass(); + __associateObjWithNative( jsobj, native ); +}; + +// +// Array: for cocos2d-hmtl5 compatibility +// +cc.ArrayRemoveObject = function (arr, delObj) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == delObj) { + arr.splice(i, 1); + } + } +}; + +// +// Google "subclasses" +// borrowed from closure library +// +var goog = goog || {}; // Check to see if already defined in current scope +goog.inherits = function (childCtor, parentCtor) { + /** @constructor */ + function tempCtor() {}; + tempCtor.prototype = parentCtor.prototype; + childCtor.superClass_ = parentCtor.prototype; + childCtor.prototype = new tempCtor(); + childCtor.prototype.constructor = childCtor; + + // Copy "static" method, but doesn't generate subclasses. +// for( var i in parentCtor ) { +// childCtor[ i ] = parentCtor[ i ]; +// } +}; +goog.base = function(me, opt_methodName, var_args) { + var caller = arguments.callee.caller; + if (caller.superClass_) { + // This is a constructor. Call the superclass constructor. + ret = caller.superClass_.constructor.apply( me, Array.prototype.slice.call(arguments, 1)); + + // XXX: SpiderMonkey bindings extensions +// __associateObjWithNative( me, ret ); + return ret; + } + + var args = Array.prototype.slice.call(arguments, 2); + var foundCaller = false; + for (var ctor = me.constructor; + ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) { + if (ctor.prototype[opt_methodName] === caller) { + foundCaller = true; + } else if (foundCaller) { + return ctor.prototype[opt_methodName].apply(me, args); + } + } + + // If we did not find the caller in the prototype chain, + // then one of two things happened: + // 1) The caller is an instance method. + // 2) This method was not called by the right caller. + if (me[opt_methodName] === caller) { + return me.constructor.prototype[opt_methodName].apply(me, args); + } else { + throw Error( + 'goog.base called from a method of one name ' + + 'to a method of a different name'); + } +}; + + +// +// Simple subclass +// + +cc.Class = function(){}; + +cc.Class.extend = function (prop) { + var _super = this.prototype; + + // Instantiate a base class (but only create the instance, + // don't run the init constructor) + initializing = true; + var prototype = new this(); + initializing = false; + fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; + + // Copy the properties over onto the new prototype + for (var name in prop) { + // Check if we're overwriting an existing function + prototype[name] = typeof prop[name] == "function" && + typeof _super[name] == "function" && fnTest.test(prop[name]) ? + (function (name, fn) { + return function () { + var tmp = this._super; + + // Add a new ._super() method that is the same method + // but on the super-class + this._super = _super[name]; + + // The method only need to be bound temporarily, so we + // remove it when we're done executing + var ret = fn.apply(this, arguments); + this._super = tmp; + + return ret; + }; + })(name, prop[name]) : + prop[name]; + } + + // The dummy class constructor + function Class() { + // All construction is actually done in the init method + if (!initializing && this.ctor) + this.ctor.apply(this, arguments); + } + + // Populate our constructed prototype object + Class.prototype = prototype; + + // Enforce the constructor to be what we expect + Class.prototype.constructor = Class; + + // And make this class extendable + Class.extend = arguments.callee; + + return Class; +}; + +cc.Layer.extend = cc.Class.extend; +cc.Scene.extend = cc.Class.extend; +cc.LayerGradient.extend = cc.Class.extend; +cc.Sprite.extend = cc.Class.extend; +cc.MenuItemFont.extend = cc.Class.extend; + +// +// Chipmunk helpers +// +var cp = cp || {}; + +cp.v = cc.p; +cp._v = cc._p; +cp.vzero = cp.v(0,0); + +// +// OpenGL Helpers +// +var gl = gl || {}; +gl.NEAREST = 0x2600; +gl.LINEAR = 0x2601; +gl.REPEAT = 0x2901; +gl.CLAMP_TO_EDGE = 0x812F; +gl.CLAMP_TO_BORDER = 0x812D; +gl.LINEAR_MIPMAP_NEAREST = 0x2701; +gl.NEAREST_MIPMAP_NEAREST = 0x2700; +gl.ZERO = 0; +gl.ONE = 1; +gl.SRC_COLOR = 0x0300; +gl.ONE_MINUS_SRC_COLOR = 0x0301; +gl.SRC_ALPHA = 0x0302; +gl.ONE_MINUS_SRC_ALPHA = 0x0303; +gl.DST_ALPHA = 0x0304; +gl.ONE_MINUS_DST_ALPHA = 0x0305; +gl.DST_COLOR = 0x0306; +gl.ONE_MINUS_DST_COLOR = 0x0307; +gl.SRC_ALPHA_SATURATE = 0x0308; + diff --git a/samples/MoonWarriors/Resources/jshelper/jsb_constants_gl.js b/samples/MoonWarriors/Resources/jshelper/jsb_constants_gl.js new file mode 100644 index 0000000000..8b9d2f701d --- /dev/null +++ b/samples/MoonWarriors/Resources/jshelper/jsb_constants_gl.js @@ -0,0 +1,23 @@ +// +// OpenGL defines +// + +var gl = gl || {}; +gl.NEAREST = 0x2600; +gl.LINEAR = 0x2601; +gl.REPEAT = 0x2901; +gl.CLAMP_TO_EDGE = 0x812F; +gl.CLAMP_TO_BORDER = 0x812D; +gl.LINEAR_MIPMAP_NEAREST = 0x2701; +gl.NEAREST_MIPMAP_NEAREST = 0x2700; +gl.ZERO = 0; +gl.ONE = 1; +gl.SRC_COLOR = 0x0300; +gl.ONE_MINUS_SRC_COLOR = 0x0301; +gl.SRC_ALPHA = 0x0302; +gl.ONE_MINUS_SRC_ALPHA = 0x0303; +gl.DST_ALPHA = 0x0304; +gl.ONE_MINUS_DST_ALPHA = 0x0305; +gl.DST_COLOR = 0x0306; +gl.ONE_MINUS_DST_COLOR = 0x0307; +gl.SRC_ALPHA_SATURATE = 0x0308; diff --git a/samples/MoonWarriors/proj.android/.classpath b/samples/MoonWarriors/proj.android/.classpath new file mode 100644 index 0000000000..a4763d1eec --- /dev/null +++ b/samples/MoonWarriors/proj.android/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/samples/MoonWarriors/proj.android/.project b/samples/MoonWarriors/proj.android/.project new file mode 100644 index 0000000000..9e6dbbfb7f --- /dev/null +++ b/samples/MoonWarriors/proj.android/.project @@ -0,0 +1,40 @@ + + + MoonWarriors + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + + + src_common + 2 + PARENT-3-PROJECT_LOC/cocos2dx/platform/android/java/src_common + + + diff --git a/samples/MoonWarriors/proj.android/AndroidManifest.xml b/samples/MoonWarriors/proj.android/AndroidManifest.xml new file mode 100644 index 0000000000..4270c77a8e --- /dev/null +++ b/samples/MoonWarriors/proj.android/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + diff --git a/samples/MoonWarriors/proj.android/ant.properties b/samples/MoonWarriors/proj.android/ant.properties new file mode 100644 index 0000000000..f8af38bfb4 --- /dev/null +++ b/samples/MoonWarriors/proj.android/ant.properties @@ -0,0 +1 @@ +aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" diff --git a/samples/MoonWarriors/proj.android/build.xml b/samples/MoonWarriors/proj.android/build.xml new file mode 100644 index 0000000000..ae419c802d --- /dev/null +++ b/samples/MoonWarriors/proj.android/build.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/MoonWarriors/proj.android/build_native.sh b/samples/MoonWarriors/proj.android/build_native.sh new file mode 100644 index 0000000000..0e10e99149 --- /dev/null +++ b/samples/MoonWarriors/proj.android/build_native.sh @@ -0,0 +1,100 @@ +APPNAME="MoonWarriors" + +# options + +buildexternalsfromsource= +PARALLEL_BUILD_FLAG= + +usage(){ +cat << EOF +usage: $0 [options] + +Build C/C++ code for $APPNAME using Android NDK + +OPTIONS: +-s Build externals from source +-p Run make with -j8 option to take advantage of multiple processors +-h this help +EOF +} + +while getopts "sph" OPTION; do +case "$OPTION" in +s) +buildexternalsfromsource=1 +;; +p) +PARALLEL_BUILD_FLAG=\-j8 +;; +h) +usage +exit 0 +;; +esac +done + +# exit this script if any commmand fails +set -e + +# paths + +if [ -z "${NDK_ROOT+aaa}" ];then +echo "please define NDK_ROOT" +exit 1 +fi + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# ... use paths relative to current directory +COCOS2DX_ROOT="$DIR/../../.." +APP_ROOT="$DIR/.." +APP_ANDROID_ROOT="$DIR" + +echo +echo "Paths" +echo " NDK_ROOT = $NDK_ROOT" +echo " COCOS2DX_ROOT = $COCOS2DX_ROOT" +echo " APP_ROOT = $APP_ROOT" +echo " APP_ANDROID_ROOT = $APP_ANDROID_ROOT" +echo + +# make sure assets is exist +if [ -d "$APP_ANDROID_ROOT"/assets ]; then + rm -rf "$APP_ANDROID_ROOT"/assets +fi + +mkdir "$APP_ANDROID_ROOT"/assets + + +# copy resources +for file in "$APP_ROOT"/Resources/* +do +if [ -d "$file" ]; then + cp -rf "$file" "$APP_ANDROID_ROOT"/assets +fi + + +if [ -f "$file" ]; then + cp "$file" "$APP_ANDROID_ROOT"/assets +fi +done + + +rm -f "$APP_ANDROID_ROOT"/assets/Images/landscape-1024x1024-rgba8888.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/test_image_rgba4444.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_a8.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_rgb888.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_rgba4444.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_rgba8888.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/test_image_rgba4444.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/texture1024x1024_rgba4444.pvr.gz +rm -f "$APP_ANDROID_ROOT"/assets/Images/PlanetCute-1024x1024-rgba4444.pvr.gz + + +echo "Using prebuilt externals" +echo + +set -x + +"$NDK_ROOT"/ndk-build $PARALLEL_BUILD_FLAG -C "$APP_ANDROID_ROOT" $* \ + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" \ + NDK_LOG=1 V=1 diff --git a/samples/MoonWarriors/proj.android/jni/Android.mk b/samples/MoonWarriors/proj.android/jni/Android.mk new file mode 100644 index 0000000000..05af70ea6e --- /dev/null +++ b/samples/MoonWarriors/proj.android/jni/Android.mk @@ -0,0 +1,28 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := test_javascript_shared + +LOCAL_MODULE_FILENAME := libtestjavascript + +LOCAL_SRC_FILES := testjavascript/main.cpp \ + ../../Classes/AppDelegate.cpp + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static +LOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static +LOCAL_WHOLE_STATIC_LIBRARIES += scriptingcore-spidermonkey + +LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,cocos2dx) +$(call import-module,CocosDenshion/android) +$(call import-module,external/chipmunk) +$(call import-module,scripting/javascript/spidermonkey-android) +$(call import-module,scripting/javascript/bindings) diff --git a/samples/MoonWarriors/proj.android/jni/Application.mk b/samples/MoonWarriors/proj.android/jni/Application.mk new file mode 100644 index 0000000000..4b8115b893 --- /dev/null +++ b/samples/MoonWarriors/proj.android/jni/Application.mk @@ -0,0 +1,3 @@ +APP_STL := gnustl_static +APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 +APP_CPPFLAGS += -DCOCOS2D_DEBUG=2 diff --git a/samples/MoonWarriors/proj.android/jni/testjavascript/main.cpp b/samples/MoonWarriors/proj.android/jni/testjavascript/main.cpp new file mode 100644 index 0000000000..2f2d1e0c10 --- /dev/null +++ b/samples/MoonWarriors/proj.android/jni/testjavascript/main.cpp @@ -0,0 +1,45 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include "CCEventType.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +extern "C" +{ + +jint JNI_OnLoad(JavaVM *vm, void *reserved) +{ + JniHelper::setJavaVM(vm); + + return JNI_VERSION_1_4; +} + +void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h) +{ + if (!CCDirector::sharedDirector()->getOpenGLView()) + { + CCEGLView *view = CCEGLView::sharedOpenGLView(); + view->setFrameSize(w, h); + + AppDelegate *pAppDelegate = new AppDelegate(); + CCApplication::sharedApplication()->run(); + } + else + { + ccDrawInit(); + ccGLInvalidateStateCache(); + + CCShaderCache::sharedShaderCache()->reloadDefaultShaders(); + CCTextureCache::reloadAllTextures(); + CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); + CCDirector::sharedDirector()->setGLDefaultValues(); + } +} + +} diff --git a/samples/MoonWarriors/proj.android/proguard-project.txt b/samples/MoonWarriors/proj.android/proguard-project.txt new file mode 100644 index 0000000000..f2fe1559a2 --- /dev/null +++ b/samples/MoonWarriors/proj.android/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/samples/MoonWarriors/proj.android/project.properties b/samples/MoonWarriors/proj.android/project.properties new file mode 100644 index 0000000000..d5f90ebab1 --- /dev/null +++ b/samples/MoonWarriors/proj.android/project.properties @@ -0,0 +1,13 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-8 + +android.library.reference.1=../../../cocos2dx/platform/android/java diff --git a/samples/MoonWarriors/proj.android/res/values/strings.xml b/samples/MoonWarriors/proj.android/res/values/strings.xml new file mode 100644 index 0000000000..707408a4d7 --- /dev/null +++ b/samples/MoonWarriors/proj.android/res/values/strings.xml @@ -0,0 +1,4 @@ + + + MoonWarriors + diff --git a/samples/MoonWarriors/proj.android/src/org/cocos2dx/testjavascript/TestJavascript.java b/samples/MoonWarriors/proj.android/src/org/cocos2dx/testjavascript/TestJavascript.java new file mode 100644 index 0000000000..9679124592 --- /dev/null +++ b/samples/MoonWarriors/proj.android/src/org/cocos2dx/testjavascript/TestJavascript.java @@ -0,0 +1,39 @@ +/**************************************************************************** +Copyright (c) 2010-2012 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +package org.cocos2dx.testjavascript; + +import org.cocos2dx.lib.Cocos2dxActivity; + +import android.os.Bundle; + +public class MoonWarriors extends Cocos2dxActivity{ + + protected void onCreate(Bundle savedInstanceState){ + super.onCreate(savedInstanceState); + } + + static { + System.loadLibrary("testjavascript"); + } +} diff --git a/samples/MoonWarriors/proj.ios/AppController.h b/samples/MoonWarriors/proj.ios/AppController.h new file mode 100644 index 0000000000..10287bd13f --- /dev/null +++ b/samples/MoonWarriors/proj.ios/AppController.h @@ -0,0 +1,17 @@ +// +// testjsAppController.h +// testjs +// +// Created by Rolando Abarca on 3/19/12. +// Copyright __MyCompanyName__ 2012. All rights reserved. +// + +@class RootViewController; + +@interface AppController : NSObject { + UIWindow *window; + RootViewController *viewController; +} + +@end + diff --git a/samples/MoonWarriors/proj.ios/AppController.mm b/samples/MoonWarriors/proj.ios/AppController.mm new file mode 100644 index 0000000000..3e3e5c9474 --- /dev/null +++ b/samples/MoonWarriors/proj.ios/AppController.mm @@ -0,0 +1,119 @@ +// +// testjsAppController.mm +// testjs +// +// Created by Rolando Abarca on 3/19/12. +// Copyright __MyCompanyName__ 2012. All rights reserved. +// +#import +#import "AppController.h" +#import "cocos2d.h" +#import "EAGLView.h" +#import "AppDelegate.h" + +#import "RootViewController.h" + +@implementation AppController + +#pragma mark - +#pragma mark Application lifecycle + +// cocos2d application instance +static AppDelegate s_sharedApplication; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + // Override point for customization after application launch. + + // Add the view controller's view to the window and display. + window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; + EAGLView *__glView = [EAGLView viewWithFrame: [window bounds] + pixelFormat: kEAGLColorFormatRGBA8 + depthFormat: GL_DEPTH_COMPONENT16 //_OES + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0 ]; + + // Use RootViewController manage EAGLView + viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; + viewController.wantsFullScreenLayout = YES; + viewController.view = __glView; + + // Set RootViewController to window + if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) + { + // warning: addSubView doesn't work on iOS6 + [window addSubview: viewController.view]; + } + else + { + // use this method on ios6 + [window setRootViewController:viewController]; + } + + [window makeKeyAndVisible]; + + [[UIApplication sharedApplication] setStatusBarHidden: YES]; + + cocos2d::CCApplication::sharedApplication()->run(); + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ + cocos2d::CCDirector::sharedDirector()->pause(); +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ + cocos2d::CCDirector::sharedDirector()->resume(); +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, called instead of applicationWillTerminate: when the user quits. + */ + cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + /* + Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. + */ + cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); +} + +- (void)applicationWillTerminate:(UIApplication *)application { + /* + Called when the application is about to terminate. + See also applicationDidEnterBackground:. + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { + /* + Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. + */ + cocos2d::CCDirector::sharedDirector()->purgeCachedData(); +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/samples/MoonWarriors/proj.ios/Default-568h@2x.png.REMOVED.git-id b/samples/MoonWarriors/proj.ios/Default-568h@2x.png.REMOVED.git-id new file mode 100644 index 0000000000..8f5838f3a8 --- /dev/null +++ b/samples/MoonWarriors/proj.ios/Default-568h@2x.png.REMOVED.git-id @@ -0,0 +1 @@ +66c6d1cead373b45218424f6a82f370897e443e4 \ No newline at end of file diff --git a/samples/MoonWarriors/proj.ios/Default@2x.png.REMOVED.git-id b/samples/MoonWarriors/proj.ios/Default@2x.png.REMOVED.git-id new file mode 100644 index 0000000000..8843505b20 --- /dev/null +++ b/samples/MoonWarriors/proj.ios/Default@2x.png.REMOVED.git-id @@ -0,0 +1 @@ +84689888a14a2123d2b39f7f2f61be8c15207479 \ No newline at end of file diff --git a/samples/MoonWarriors/proj.ios/MoonWarriors.xcodeproj/project.pbxproj b/samples/MoonWarriors/proj.ios/MoonWarriors.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..6c72c9f956 --- /dev/null +++ b/samples/MoonWarriors/proj.ios/MoonWarriors.xcodeproj/project.pbxproj @@ -0,0 +1,1254 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 15384E5716119CC30021DC07 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E3E16119CC30021DC07 /* CCPhysicsSprite.cpp */; }; + 15384E5816119CC30021DC07 /* cocos2d_specifics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E4016119CC30021DC07 /* cocos2d_specifics.cpp */; }; + 15384E5916119CC30021DC07 /* cocosjs_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E4216119CC30021DC07 /* cocosjs_manual_conversions.cpp */; }; + 15384E5A16119CC30021DC07 /* cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E4516119CC30021DC07 /* cocos2dx.cpp */; }; + 15384E5D16119CC30021DC07 /* js_bindings_ccbreader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E4916119CC30021DC07 /* js_bindings_ccbreader.cpp */; }; + 15384E5E16119CC30021DC07 /* js_bindings_chipmunk_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E4B16119CC30021DC07 /* js_bindings_chipmunk_functions.cpp */; }; + 15384E5F16119CC30021DC07 /* js_bindings_chipmunk_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E4D16119CC30021DC07 /* js_bindings_chipmunk_manual.cpp */; }; + 15384E6016119CC30021DC07 /* js_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E5016119CC30021DC07 /* js_manual_conversions.cpp */; }; + 15384E6116119CC30021DC07 /* ScriptingCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E5216119CC30021DC07 /* ScriptingCore.cpp */; }; + 15384ED716119D5E0021DC07 /* CCBAnimationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E6516119D5E0021DC07 /* CCBAnimationManager.cpp */; }; + 15384ED816119D5E0021DC07 /* CCBFileLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E6716119D5E0021DC07 /* CCBFileLoader.cpp */; }; + 15384ED916119D5E0021DC07 /* CCBKeyframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E6916119D5E0021DC07 /* CCBKeyframe.cpp */; }; + 15384EDA16119D5E0021DC07 /* CCBReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E6C16119D5E0021DC07 /* CCBReader.cpp */; }; + 15384EDB16119D5E0021DC07 /* CCBSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E6F16119D5E0021DC07 /* CCBSequence.cpp */; }; + 15384EDC16119D5E0021DC07 /* CCBSequenceProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7116119D5E0021DC07 /* CCBSequenceProperty.cpp */; }; + 15384EDD16119D5E0021DC07 /* CCBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7316119D5E0021DC07 /* CCBValue.cpp */; }; + 15384EDE16119D5E0021DC07 /* CCControlButtonLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7516119D5E0021DC07 /* CCControlButtonLoader.cpp */; }; + 15384EDF16119D5E0021DC07 /* CCControlLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7716119D5E0021DC07 /* CCControlLoader.cpp */; }; + 15384EE016119D5E0021DC07 /* CCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7916119D5E0021DC07 /* CCData.cpp */; }; + 15384EE116119D5E0021DC07 /* CCLabelBMFontLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7B16119D5E0021DC07 /* CCLabelBMFontLoader.cpp */; }; + 15384EE216119D5E0021DC07 /* CCLabelTTFLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7D16119D5E0021DC07 /* CCLabelTTFLoader.cpp */; }; + 15384EE316119D5E0021DC07 /* CCLayerColorLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E7F16119D5E0021DC07 /* CCLayerColorLoader.cpp */; }; + 15384EE416119D5E0021DC07 /* CCLayerGradientLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E8116119D5E0021DC07 /* CCLayerGradientLoader.cpp */; }; + 15384EE516119D5E0021DC07 /* CCLayerLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E8316119D5E0021DC07 /* CCLayerLoader.cpp */; }; + 15384EE616119D5E0021DC07 /* CCMenuItemImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E8516119D5E0021DC07 /* CCMenuItemImageLoader.cpp */; }; + 15384EE716119D5E0021DC07 /* CCMenuItemLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E8716119D5E0021DC07 /* CCMenuItemLoader.cpp */; }; + 15384EE816119D5E0021DC07 /* CCNode+CCBRelativePositioning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E8A16119D5E0021DC07 /* CCNode+CCBRelativePositioning.cpp */; }; + 15384EE916119D5E0021DC07 /* CCNodeLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E8C16119D5E0021DC07 /* CCNodeLoader.cpp */; }; + 15384EEA16119D5E0021DC07 /* CCNodeLoaderLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E8E16119D5E0021DC07 /* CCNodeLoaderLibrary.cpp */; }; + 15384EEB16119D5E0021DC07 /* CCParticleSystemQuadLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E9116119D5E0021DC07 /* CCParticleSystemQuadLoader.cpp */; }; + 15384EEC16119D5E0021DC07 /* CCScale9SpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E9316119D5E0021DC07 /* CCScale9SpriteLoader.cpp */; }; + 15384EED16119D5E0021DC07 /* CCScrollViewLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E9516119D5E0021DC07 /* CCScrollViewLoader.cpp */; }; + 15384EEE16119D5E0021DC07 /* CCSpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384E9716119D5E0021DC07 /* CCSpriteLoader.cpp */; }; + 15384EFB16119D5E0021DC07 /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384EB716119D5E0021DC07 /* CCEditBox.cpp */; }; + 15384EFD16119D5E0021DC07 /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15384EBD16119D5E0021DC07 /* CCEditBoxImplIOS.mm */; }; + 15384EFE16119D5E0021DC07 /* EditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15384EBF16119D5E0021DC07 /* EditBoxImplIOS.mm */; }; + 15384EFF16119D5E0021DC07 /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384EC116119D5E0021DC07 /* CCScrollView.cpp */; }; + 15384F0016119D5E0021DC07 /* CCSorting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384EC316119D5E0021DC07 /* CCSorting.cpp */; }; + 15384F0116119D5E0021DC07 /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384EC516119D5E0021DC07 /* CCTableView.cpp */; }; + 15384F0216119D5E0021DC07 /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15384EC716119D5E0021DC07 /* CCTableViewCell.cpp */; }; + 15426FC315B5742200712A7F /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15426AF115B5733200712A7F /* libcocos2dx.a */; }; + 15426FE615B5743C00712A7F /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 15426FD015B5743C00712A7F /* CDAudioManager.m */; }; + 15426FE715B5743C00712A7F /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 15426FD315B5743C00712A7F /* CDOpenALSupport.m */; }; + 15426FE815B5743C00712A7F /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = 15426FD515B5743C00712A7F /* CocosDenshion.m */; }; + 15426FE915B5743C00712A7F /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15426FD615B5743C00712A7F /* SimpleAudioEngine.mm */; }; + 15426FEA15B5743C00712A7F /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = 15426FD815B5743C00712A7F /* SimpleAudioEngine_objc.m */; }; + 15628F6C15F0F5E5000CF24B /* ballbounce.wav in Resources */ = {isa = PBXBuildFile; fileRef = 15628F5D15F0F5E5000CF24B /* ballbounce.wav */; }; + 15628F6D15F0F5E5000CF24B /* cowbell.wav in Resources */ = {isa = PBXBuildFile; fileRef = 15628F5E15F0F5E5000CF24B /* cowbell.wav */; }; + 15628F6E15F0F5E5000CF24B /* Cyber Advance!.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 15628F5F15F0F5E5000CF24B /* Cyber Advance!.mp3 */; }; + 15628F6F15F0F5E5000CF24B /* Fonts in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6015F0F5E5000CF24B /* Fonts */; }; + 15628F7015F0F5E5000CF24B /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6115F0F5E5000CF24B /* Images */; }; + 15628F7115F0F5E5000CF24B /* js in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6215F0F5E5000CF24B /* js */; }; + 15628F7215F0F5E5000CF24B /* oldjs in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6315F0F5E5000CF24B /* oldjs */; }; + 15628F7315F0F5E5000CF24B /* Particles in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6415F0F5E5000CF24B /* Particles */; }; + 15628F7415F0F5E5000CF24B /* Silly Fun Theme A.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6515F0F5E5000CF24B /* Silly Fun Theme A.mp3 */; }; + 15628F7515F0F5E5000CF24B /* tank.plist in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6615F0F5E5000CF24B /* tank.plist */; }; + 15628F7615F0F5E5000CF24B /* tank.png in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6715F0F5E5000CF24B /* tank.png */; }; + 15628F7715F0F5E5000CF24B /* tank.tps in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6815F0F5E5000CF24B /* tank.tps */; }; + 15628F7815F0F5E5000CF24B /* tank1.png in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6915F0F5E5000CF24B /* tank1.png */; }; + 15628F7915F0F5E5000CF24B /* TileMaps in Resources */ = {isa = PBXBuildFile; fileRef = 15628F6A15F0F5E5000CF24B /* TileMaps */; }; + 15628FA915F1057E000CF24B /* animations in Resources */ = {isa = PBXBuildFile; fileRef = 15628FA815F1057E000CF24B /* animations */; }; + 15CFE1A61612FD0E00BF2188 /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE18D1612FD0E00BF2188 /* CCControl.cpp */; }; + 15CFE1A71612FD0E00BF2188 /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE18F1612FD0E00BF2188 /* CCControlButton.cpp */; }; + 15CFE1A81612FD0E00BF2188 /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE1911612FD0E00BF2188 /* CCControlColourPicker.cpp */; }; + 15CFE1A91612FD0E00BF2188 /* CCControlHuePicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE1941612FD0E00BF2188 /* CCControlHuePicker.cpp */; }; + 15CFE1AA1612FD0E00BF2188 /* CCControlPotentiometer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE1961612FD0E00BF2188 /* CCControlPotentiometer.cpp */; }; + 15CFE1AB1612FD0E00BF2188 /* CCControlSaturationBrightnessPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE1981612FD0E00BF2188 /* CCControlSaturationBrightnessPicker.cpp */; }; + 15CFE1AC1612FD0E00BF2188 /* CCControlSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE19A1612FD0E00BF2188 /* CCControlSlider.cpp */; }; + 15CFE1AD1612FD0E00BF2188 /* CCControlStepper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE19C1612FD0E00BF2188 /* CCControlStepper.cpp */; }; + 15CFE1AE1612FD0E00BF2188 /* CCControlSwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE19E1612FD0E00BF2188 /* CCControlSwitch.cpp */; }; + 15CFE1AF1612FD0E00BF2188 /* CCControlUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE1A01612FD0E00BF2188 /* CCControlUtils.cpp */; }; + 15CFE1B01612FD0E00BF2188 /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE1A21612FD0E00BF2188 /* CCInvocation.cpp */; }; + 15CFE1B11612FD0E00BF2188 /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CFE1A41612FD0E00BF2188 /* CCScale9Sprite.cpp */; }; + 262829CC15EC7196002C4240 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 2628297D15EC7196002C4240 /* .gitignore */; }; + 262829CD15EC7196002C4240 /* Android.mk in Resources */ = {isa = PBXBuildFile; fileRef = 2628297E15EC7196002C4240 /* Android.mk */; }; + 262829CE15EC7196002C4240 /* chipmunk-docs.html in Resources */ = {isa = PBXBuildFile; fileRef = 2628297F15EC7196002C4240 /* chipmunk-docs.html */; }; + 262829CF15EC7196002C4240 /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = 2628299C15EC7196002C4240 /* LICENSE.txt */; }; + 262829D015EC7196002C4240 /* .cproject in Resources */ = {isa = PBXBuildFile; fileRef = 2628299E15EC7196002C4240 /* .cproject */; }; + 262829D115EC7196002C4240 /* .project in Resources */ = {isa = PBXBuildFile; fileRef = 2628299F15EC7196002C4240 /* .project */; }; + 262829D215EC7196002C4240 /* .cproject in Resources */ = {isa = PBXBuildFile; fileRef = 262829A115EC7196002C4240 /* .cproject */; }; + 262829D315EC7196002C4240 /* .project in Resources */ = {isa = PBXBuildFile; fileRef = 262829A215EC7196002C4240 /* .project */; }; + 262829D415EC7196002C4240 /* Makefile in Sources */ = {isa = PBXBuildFile; fileRef = 262829A315EC7196002C4240 /* Makefile */; }; + 262829D515EC7196002C4240 /* chipmunk.vcproj in Resources */ = {isa = PBXBuildFile; fileRef = 262829A515EC7196002C4240 /* chipmunk.vcproj */; }; + 262829D615EC7196002C4240 /* chipmunk.vcproj.user in Resources */ = {isa = PBXBuildFile; fileRef = 262829A615EC7196002C4240 /* chipmunk.vcproj.user */; }; + 262829D715EC7196002C4240 /* chipmunk.vcxproj in Resources */ = {isa = PBXBuildFile; fileRef = 262829A715EC7196002C4240 /* chipmunk.vcxproj */; }; + 262829D815EC7196002C4240 /* chipmunk.vcxproj.filters in Resources */ = {isa = PBXBuildFile; fileRef = 262829A815EC7196002C4240 /* chipmunk.vcxproj.filters */; }; + 262829D915EC7196002C4240 /* chipmunk.vcxproj.user in Resources */ = {isa = PBXBuildFile; fileRef = 262829A915EC7196002C4240 /* chipmunk.vcxproj.user */; }; + 262829DA15EC7196002C4240 /* README.txt in Resources */ = {isa = PBXBuildFile; fileRef = 262829AA15EC7196002C4240 /* README.txt */; }; + 262829DB15EC7196002C4240 /* chipmunk.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829AC15EC7196002C4240 /* chipmunk.c */; }; + 262829DC15EC7196002C4240 /* CMakeLists.txt in Resources */ = {isa = PBXBuildFile; fileRef = 262829AD15EC7196002C4240 /* CMakeLists.txt */; }; + 262829DD15EC7196002C4240 /* cpConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829AF15EC7196002C4240 /* cpConstraint.c */; }; + 262829DE15EC7196002C4240 /* cpDampedRotarySpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B015EC7196002C4240 /* cpDampedRotarySpring.c */; }; + 262829DF15EC7196002C4240 /* cpDampedSpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B115EC7196002C4240 /* cpDampedSpring.c */; }; + 262829E015EC7196002C4240 /* cpGearJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B215EC7196002C4240 /* cpGearJoint.c */; }; + 262829E115EC7196002C4240 /* cpGrooveJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B315EC7196002C4240 /* cpGrooveJoint.c */; }; + 262829E215EC7196002C4240 /* cpPinJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B415EC7196002C4240 /* cpPinJoint.c */; }; + 262829E315EC7196002C4240 /* cpPivotJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B515EC7196002C4240 /* cpPivotJoint.c */; }; + 262829E415EC7196002C4240 /* cpRatchetJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B615EC7196002C4240 /* cpRatchetJoint.c */; }; + 262829E515EC7196002C4240 /* cpRotaryLimitJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B715EC7196002C4240 /* cpRotaryLimitJoint.c */; }; + 262829E615EC7196002C4240 /* cpSimpleMotor.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B815EC7196002C4240 /* cpSimpleMotor.c */; }; + 262829E715EC7196002C4240 /* cpSlideJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829B915EC7196002C4240 /* cpSlideJoint.c */; }; + 262829E815EC7196002C4240 /* cpArbiter.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829BA15EC7196002C4240 /* cpArbiter.c */; }; + 262829E915EC7196002C4240 /* cpArray.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829BB15EC7196002C4240 /* cpArray.c */; }; + 262829EA15EC7196002C4240 /* cpBB.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829BC15EC7196002C4240 /* cpBB.c */; }; + 262829EB15EC7196002C4240 /* cpBBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829BD15EC7196002C4240 /* cpBBTree.c */; }; + 262829EC15EC7196002C4240 /* cpBody.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829BE15EC7196002C4240 /* cpBody.c */; }; + 262829ED15EC7196002C4240 /* cpCollision.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829BF15EC7196002C4240 /* cpCollision.c */; }; + 262829EE15EC7196002C4240 /* cpHashSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C015EC7196002C4240 /* cpHashSet.c */; }; + 262829EF15EC7196002C4240 /* cpPolyShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C115EC7196002C4240 /* cpPolyShape.c */; }; + 262829F015EC7196002C4240 /* cpShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C215EC7196002C4240 /* cpShape.c */; }; + 262829F115EC7196002C4240 /* cpSpace.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C315EC7196002C4240 /* cpSpace.c */; }; + 262829F215EC7196002C4240 /* cpSpaceComponent.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C415EC7196002C4240 /* cpSpaceComponent.c */; }; + 262829F315EC7196002C4240 /* cpSpaceHash.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C515EC7196002C4240 /* cpSpaceHash.c */; }; + 262829F415EC7196002C4240 /* cpSpaceQuery.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C615EC7196002C4240 /* cpSpaceQuery.c */; }; + 262829F515EC7196002C4240 /* cpSpaceStep.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C715EC7196002C4240 /* cpSpaceStep.c */; }; + 262829F615EC7196002C4240 /* cpSpatialIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C815EC7196002C4240 /* cpSpatialIndex.c */; }; + 262829F715EC7196002C4240 /* cpSweep1D.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829C915EC7196002C4240 /* cpSweep1D.c */; }; + 262829F815EC7196002C4240 /* cpVect.c in Sources */ = {isa = PBXBuildFile; fileRef = 262829CA15EC7196002C4240 /* cpVect.c */; }; + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275411517C094001B78AA /* QuartzCore.framework */; }; + A92275441517C094001B78AA /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275431517C094001B78AA /* OpenGLES.framework */; }; + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275451517C094001B78AA /* OpenAL.framework */; }; + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275471517C094001B78AA /* AudioToolbox.framework */; }; + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; + A922754C1517C094001B78AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754B1517C094001B78AA /* UIKit.framework */; }; + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; + D446FDA316102D7D000ADA7B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = D446FDA216102D7D000ADA7B /* Default.png */; }; + D446FDA516102D82000ADA7B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D446FDA416102D82000ADA7B /* Default@2x.png */; }; + D446FDA716102D86000ADA7B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D446FDA616102D86000ADA7B /* Default-568h@2x.png */; }; + D45446D3156DE74F00887EB5 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = D45446CE156DE74F00887EB5 /* AppController.mm */; }; + D45446D4156DE74F00887EB5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D45446CF156DE74F00887EB5 /* main.m */; }; + D45446D5156DE74F00887EB5 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = D45446D2156DE74F00887EB5 /* RootViewController.mm */; }; + D454520A156E22B400887EB5 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D4545209156E22B400887EB5 /* libxml2.dylib */; }; + D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D454520B156E22BD00887EB5 /* libz.dylib */; }; + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D4545215156E28EF00887EB5 /* AppDelegate.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 15426AF015B5733200712A7F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15426AE915B5733200712A7F /* cocos2dx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1551A33F158F2AB200E66CFE; + remoteInfo = cocos2dx; + }; + 15426FC115B5741900712A7F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15426AE915B5733200712A7F /* cocos2dx.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1551A33E158F2AB200E66CFE; + remoteInfo = cocos2dx; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 15384E3E16119CC30021DC07 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = ""; }; + 15384E3F16119CC30021DC07 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = ""; }; + 15384E4016119CC30021DC07 /* cocos2d_specifics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cocos2d_specifics.cpp; sourceTree = ""; }; + 15384E4116119CC30021DC07 /* cocos2d_specifics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cocos2d_specifics.hpp; sourceTree = ""; }; + 15384E4216119CC30021DC07 /* cocosjs_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cocosjs_manual_conversions.cpp; sourceTree = ""; }; + 15384E4316119CC30021DC07 /* cocosjs_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocosjs_manual_conversions.h; sourceTree = ""; }; + 15384E4516119CC30021DC07 /* cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cocos2dx.cpp; sourceTree = ""; }; + 15384E4616119CC30021DC07 /* cocos2dx.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cocos2dx.hpp; sourceTree = ""; }; + 15384E4916119CC30021DC07 /* js_bindings_ccbreader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_ccbreader.cpp; sourceTree = ""; }; + 15384E4A16119CC30021DC07 /* js_bindings_ccbreader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_ccbreader.h; sourceTree = ""; }; + 15384E4B16119CC30021DC07 /* js_bindings_chipmunk_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_chipmunk_functions.cpp; sourceTree = ""; }; + 15384E4C16119CC30021DC07 /* js_bindings_chipmunk_functions.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = js_bindings_chipmunk_functions.hpp; sourceTree = ""; }; + 15384E4D16119CC30021DC07 /* js_bindings_chipmunk_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_chipmunk_manual.cpp; sourceTree = ""; }; + 15384E4E16119CC30021DC07 /* js_bindings_chipmunk_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = js_bindings_chipmunk_manual.hpp; sourceTree = ""; }; + 15384E4F16119CC30021DC07 /* js_bindings_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_config.h; sourceTree = ""; }; + 15384E5016119CC30021DC07 /* js_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_manual_conversions.cpp; sourceTree = ""; }; + 15384E5116119CC30021DC07 /* js_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_manual_conversions.h; sourceTree = ""; }; + 15384E5216119CC30021DC07 /* ScriptingCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptingCore.cpp; sourceTree = ""; }; + 15384E5316119CC30021DC07 /* ScriptingCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptingCore.h; sourceTree = ""; }; + 15384E5416119CC30021DC07 /* spidermonkey_specifics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spidermonkey_specifics.h; sourceTree = ""; }; + 15384E5516119CC30021DC07 /* uthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uthash.h; sourceTree = ""; }; + 15384E6516119D5E0021DC07 /* CCBAnimationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBAnimationManager.cpp; sourceTree = ""; }; + 15384E6616119D5E0021DC07 /* CCBAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBAnimationManager.h; sourceTree = ""; }; + 15384E6716119D5E0021DC07 /* CCBFileLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBFileLoader.cpp; sourceTree = ""; }; + 15384E6816119D5E0021DC07 /* CCBFileLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBFileLoader.h; sourceTree = ""; }; + 15384E6916119D5E0021DC07 /* CCBKeyframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBKeyframe.cpp; sourceTree = ""; }; + 15384E6A16119D5E0021DC07 /* CCBKeyframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBKeyframe.h; sourceTree = ""; }; + 15384E6B16119D5E0021DC07 /* CCBMemberVariableAssigner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBMemberVariableAssigner.h; sourceTree = ""; }; + 15384E6C16119D5E0021DC07 /* CCBReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBReader.cpp; sourceTree = ""; }; + 15384E6D16119D5E0021DC07 /* CCBReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBReader.h; sourceTree = ""; }; + 15384E6E16119D5E0021DC07 /* CCBSelectorResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSelectorResolver.h; sourceTree = ""; }; + 15384E6F16119D5E0021DC07 /* CCBSequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequence.cpp; sourceTree = ""; }; + 15384E7016119D5E0021DC07 /* CCBSequence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequence.h; sourceTree = ""; }; + 15384E7116119D5E0021DC07 /* CCBSequenceProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequenceProperty.cpp; sourceTree = ""; }; + 15384E7216119D5E0021DC07 /* CCBSequenceProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequenceProperty.h; sourceTree = ""; }; + 15384E7316119D5E0021DC07 /* CCBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBValue.cpp; sourceTree = ""; }; + 15384E7416119D5E0021DC07 /* CCBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBValue.h; sourceTree = ""; }; + 15384E7516119D5E0021DC07 /* CCControlButtonLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButtonLoader.cpp; sourceTree = ""; }; + 15384E7616119D5E0021DC07 /* CCControlButtonLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButtonLoader.h; sourceTree = ""; }; + 15384E7716119D5E0021DC07 /* CCControlLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlLoader.cpp; sourceTree = ""; }; + 15384E7816119D5E0021DC07 /* CCControlLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlLoader.h; sourceTree = ""; }; + 15384E7916119D5E0021DC07 /* CCData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCData.cpp; sourceTree = ""; }; + 15384E7A16119D5E0021DC07 /* CCData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCData.h; sourceTree = ""; }; + 15384E7B16119D5E0021DC07 /* CCLabelBMFontLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelBMFontLoader.cpp; sourceTree = ""; }; + 15384E7C16119D5E0021DC07 /* CCLabelBMFontLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelBMFontLoader.h; sourceTree = ""; }; + 15384E7D16119D5E0021DC07 /* CCLabelTTFLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelTTFLoader.cpp; sourceTree = ""; }; + 15384E7E16119D5E0021DC07 /* CCLabelTTFLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTFLoader.h; sourceTree = ""; }; + 15384E7F16119D5E0021DC07 /* CCLayerColorLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerColorLoader.cpp; sourceTree = ""; }; + 15384E8016119D5E0021DC07 /* CCLayerColorLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerColorLoader.h; sourceTree = ""; }; + 15384E8116119D5E0021DC07 /* CCLayerGradientLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerGradientLoader.cpp; sourceTree = ""; }; + 15384E8216119D5E0021DC07 /* CCLayerGradientLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerGradientLoader.h; sourceTree = ""; }; + 15384E8316119D5E0021DC07 /* CCLayerLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerLoader.cpp; sourceTree = ""; }; + 15384E8416119D5E0021DC07 /* CCLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerLoader.h; sourceTree = ""; }; + 15384E8516119D5E0021DC07 /* CCMenuItemImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemImageLoader.cpp; sourceTree = ""; }; + 15384E8616119D5E0021DC07 /* CCMenuItemImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemImageLoader.h; sourceTree = ""; }; + 15384E8716119D5E0021DC07 /* CCMenuItemLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemLoader.cpp; sourceTree = ""; }; + 15384E8816119D5E0021DC07 /* CCMenuItemLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemLoader.h; sourceTree = ""; }; + 15384E8916119D5E0021DC07 /* CCMenuLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuLoader.h; sourceTree = ""; }; + 15384E8A16119D5E0021DC07 /* CCNode+CCBRelativePositioning.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "CCNode+CCBRelativePositioning.cpp"; sourceTree = ""; }; + 15384E8B16119D5E0021DC07 /* CCNode+CCBRelativePositioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCNode+CCBRelativePositioning.h"; sourceTree = ""; }; + 15384E8C16119D5E0021DC07 /* CCNodeLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoader.cpp; sourceTree = ""; }; + 15384E8D16119D5E0021DC07 /* CCNodeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoader.h; sourceTree = ""; }; + 15384E8E16119D5E0021DC07 /* CCNodeLoaderLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoaderLibrary.cpp; sourceTree = ""; }; + 15384E8F16119D5E0021DC07 /* CCNodeLoaderLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderLibrary.h; sourceTree = ""; }; + 15384E9016119D5E0021DC07 /* CCNodeLoaderListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderListener.h; sourceTree = ""; }; + 15384E9116119D5E0021DC07 /* CCParticleSystemQuadLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParticleSystemQuadLoader.cpp; sourceTree = ""; }; + 15384E9216119D5E0021DC07 /* CCParticleSystemQuadLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuadLoader.h; sourceTree = ""; }; + 15384E9316119D5E0021DC07 /* CCScale9SpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9SpriteLoader.cpp; sourceTree = ""; }; + 15384E9416119D5E0021DC07 /* CCScale9SpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScale9SpriteLoader.h; sourceTree = ""; }; + 15384E9516119D5E0021DC07 /* CCScrollViewLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScrollViewLoader.cpp; sourceTree = ""; }; + 15384E9616119D5E0021DC07 /* CCScrollViewLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollViewLoader.h; sourceTree = ""; }; + 15384E9716119D5E0021DC07 /* CCSpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteLoader.cpp; sourceTree = ""; }; + 15384E9816119D5E0021DC07 /* CCSpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteLoader.h; sourceTree = ""; }; + 15384E9916119D5E0021DC07 /* cocos-ext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "cocos-ext.h"; sourceTree = ""; }; + 15384E9A16119D5E0021DC07 /* ExtensionMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionMacros.h; sourceTree = ""; }; + 15384EB716119D5E0021DC07 /* CCEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBox.cpp; sourceTree = ""; }; + 15384EB816119D5E0021DC07 /* CCEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBox.h; sourceTree = ""; }; + 15384EB916119D5E0021DC07 /* CCEditBoxImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImpl.h; sourceTree = ""; }; + 15384EBC16119D5E0021DC07 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = ""; }; + 15384EBD16119D5E0021DC07 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = ""; }; + 15384EBE16119D5E0021DC07 /* EditBoxImplIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditBoxImplIOS.h; sourceTree = ""; }; + 15384EBF16119D5E0021DC07 /* EditBoxImplIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditBoxImplIOS.mm; sourceTree = ""; }; + 15384EC116119D5E0021DC07 /* CCScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScrollView.cpp; sourceTree = ""; }; + 15384EC216119D5E0021DC07 /* CCScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = ""; }; + 15384EC316119D5E0021DC07 /* CCSorting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSorting.cpp; sourceTree = ""; }; + 15384EC416119D5E0021DC07 /* CCSorting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSorting.h; sourceTree = ""; }; + 15384EC516119D5E0021DC07 /* CCTableView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = ""; }; + 15384EC616119D5E0021DC07 /* CCTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTableView.h; sourceTree = ""; }; + 15384EC716119D5E0021DC07 /* CCTableViewCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableViewCell.cpp; sourceTree = ""; }; + 15384EC816119D5E0021DC07 /* CCTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTableViewCell.h; sourceTree = ""; }; + 15426AE915B5733200712A7F /* cocos2dx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2dx.xcodeproj; path = ../../../cocos2dx/proj.ios/cocos2dx.xcodeproj; sourceTree = ""; }; + 15426FCC15B5743C00712A7F /* Export.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; }; + 15426FCD15B5743C00712A7F /* SimpleAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine.h; sourceTree = ""; }; + 15426FCF15B5743C00712A7F /* CDAudioManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = ""; }; + 15426FD015B5743C00712A7F /* CDAudioManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = ""; }; + 15426FD115B5743C00712A7F /* CDConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = ""; }; + 15426FD215B5743C00712A7F /* CDOpenALSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = ""; }; + 15426FD315B5743C00712A7F /* CDOpenALSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = ""; }; + 15426FD415B5743C00712A7F /* CocosDenshion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = ""; }; + 15426FD515B5743C00712A7F /* CocosDenshion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = ""; }; + 15426FD615B5743C00712A7F /* SimpleAudioEngine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleAudioEngine.mm; sourceTree = ""; }; + 15426FD715B5743C00712A7F /* SimpleAudioEngine_objc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine_objc.h; sourceTree = ""; }; + 15426FD815B5743C00712A7F /* SimpleAudioEngine_objc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine_objc.m; sourceTree = ""; }; + 15628F5D15F0F5E5000CF24B /* ballbounce.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = ballbounce.wav; path = ../Resources/ballbounce.wav; sourceTree = ""; }; + 15628F5E15F0F5E5000CF24B /* cowbell.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = cowbell.wav; path = ../Resources/cowbell.wav; sourceTree = ""; }; + 15628F5F15F0F5E5000CF24B /* Cyber Advance!.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = "Cyber Advance!.mp3"; path = "../Resources/Cyber Advance!.mp3"; sourceTree = ""; }; + 15628F6015F0F5E5000CF24B /* Fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Fonts; path = ../Resources/Fonts; sourceTree = ""; }; + 15628F6115F0F5E5000CF24B /* Images */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Images; path = ../Resources/Images; sourceTree = ""; }; + 15628F6215F0F5E5000CF24B /* js */ = {isa = PBXFileReference; lastKnownFileType = folder; name = js; path = ../Resources/js; sourceTree = ""; }; + 15628F6315F0F5E5000CF24B /* oldjs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = oldjs; path = ../Resources/oldjs; sourceTree = ""; }; + 15628F6415F0F5E5000CF24B /* Particles */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Particles; path = ../Resources/Particles; sourceTree = ""; }; + 15628F6515F0F5E5000CF24B /* Silly Fun Theme A.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = "Silly Fun Theme A.mp3"; path = "../Resources/Silly Fun Theme A.mp3"; sourceTree = ""; }; + 15628F6615F0F5E5000CF24B /* tank.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = tank.plist; path = ../Resources/tank.plist; sourceTree = ""; }; + 15628F6715F0F5E5000CF24B /* tank.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = tank.png; path = ../Resources/tank.png; sourceTree = ""; }; + 15628F6815F0F5E5000CF24B /* tank.tps */ = {isa = PBXFileReference; lastKnownFileType = file; name = tank.tps; path = ../Resources/tank.tps; sourceTree = ""; }; + 15628F6915F0F5E5000CF24B /* tank1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = tank1.png; path = ../Resources/tank1.png; sourceTree = ""; }; + 15628F6A15F0F5E5000CF24B /* TileMaps */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TileMaps; path = ../Resources/TileMaps; sourceTree = ""; }; + 15628FA815F1057E000CF24B /* animations */ = {isa = PBXFileReference; lastKnownFileType = folder; name = animations; path = ../Resources/animations; sourceTree = ""; }; + 15CFE18D1612FD0E00BF2188 /* CCControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControl.cpp; sourceTree = ""; }; + 15CFE18E1612FD0E00BF2188 /* CCControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControl.h; sourceTree = ""; }; + 15CFE18F1612FD0E00BF2188 /* CCControlButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButton.cpp; sourceTree = ""; }; + 15CFE1901612FD0E00BF2188 /* CCControlButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButton.h; sourceTree = ""; }; + 15CFE1911612FD0E00BF2188 /* CCControlColourPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlColourPicker.cpp; sourceTree = ""; }; + 15CFE1921612FD0E00BF2188 /* CCControlColourPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlColourPicker.h; sourceTree = ""; }; + 15CFE1931612FD0E00BF2188 /* CCControlExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlExtensions.h; sourceTree = ""; }; + 15CFE1941612FD0E00BF2188 /* CCControlHuePicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlHuePicker.cpp; sourceTree = ""; }; + 15CFE1951612FD0E00BF2188 /* CCControlHuePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlHuePicker.h; sourceTree = ""; }; + 15CFE1961612FD0E00BF2188 /* CCControlPotentiometer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlPotentiometer.cpp; sourceTree = ""; }; + 15CFE1971612FD0E00BF2188 /* CCControlPotentiometer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlPotentiometer.h; sourceTree = ""; }; + 15CFE1981612FD0E00BF2188 /* CCControlSaturationBrightnessPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSaturationBrightnessPicker.cpp; sourceTree = ""; }; + 15CFE1991612FD0E00BF2188 /* CCControlSaturationBrightnessPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSaturationBrightnessPicker.h; sourceTree = ""; }; + 15CFE19A1612FD0E00BF2188 /* CCControlSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSlider.cpp; sourceTree = ""; }; + 15CFE19B1612FD0E00BF2188 /* CCControlSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSlider.h; sourceTree = ""; }; + 15CFE19C1612FD0E00BF2188 /* CCControlStepper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlStepper.cpp; sourceTree = ""; }; + 15CFE19D1612FD0E00BF2188 /* CCControlStepper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlStepper.h; sourceTree = ""; }; + 15CFE19E1612FD0E00BF2188 /* CCControlSwitch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSwitch.cpp; sourceTree = ""; }; + 15CFE19F1612FD0E00BF2188 /* CCControlSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSwitch.h; sourceTree = ""; }; + 15CFE1A01612FD0E00BF2188 /* CCControlUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlUtils.cpp; sourceTree = ""; }; + 15CFE1A11612FD0E00BF2188 /* CCControlUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlUtils.h; sourceTree = ""; }; + 15CFE1A21612FD0E00BF2188 /* CCInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCInvocation.cpp; sourceTree = ""; }; + 15CFE1A31612FD0E00BF2188 /* CCInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = ""; }; + 15CFE1A41612FD0E00BF2188 /* CCScale9Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9Sprite.cpp; sourceTree = ""; }; + 15CFE1A51612FD0E00BF2188 /* CCScale9Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScale9Sprite.h; sourceTree = ""; }; + 2628297D15EC7196002C4240 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; + 2628297E15EC7196002C4240 /* Android.mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Android.mk; sourceTree = ""; }; + 2628297F15EC7196002C4240 /* chipmunk-docs.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "chipmunk-docs.html"; sourceTree = ""; }; + 2628298215EC7196002C4240 /* chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk.h; sourceTree = ""; }; + 2628298315EC7196002C4240 /* chipmunk_ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_ffi.h; sourceTree = ""; }; + 2628298415EC7196002C4240 /* chipmunk_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_private.h; sourceTree = ""; }; + 2628298515EC7196002C4240 /* chipmunk_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_types.h; sourceTree = ""; }; + 2628298615EC7196002C4240 /* chipmunk_unsafe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = chipmunk_unsafe.h; sourceTree = ""; }; + 2628298815EC7196002C4240 /* cpConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpConstraint.h; sourceTree = ""; }; + 2628298915EC7196002C4240 /* cpDampedRotarySpring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpDampedRotarySpring.h; sourceTree = ""; }; + 2628298A15EC7196002C4240 /* cpDampedSpring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpDampedSpring.h; sourceTree = ""; }; + 2628298B15EC7196002C4240 /* cpGearJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpGearJoint.h; sourceTree = ""; }; + 2628298C15EC7196002C4240 /* cpGrooveJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpGrooveJoint.h; sourceTree = ""; }; + 2628298D15EC7196002C4240 /* cpPinJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPinJoint.h; sourceTree = ""; }; + 2628298E15EC7196002C4240 /* cpPivotJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPivotJoint.h; sourceTree = ""; }; + 2628298F15EC7196002C4240 /* cpRatchetJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpRatchetJoint.h; sourceTree = ""; }; + 2628299015EC7196002C4240 /* cpRotaryLimitJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpRotaryLimitJoint.h; sourceTree = ""; }; + 2628299115EC7196002C4240 /* cpSimpleMotor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSimpleMotor.h; sourceTree = ""; }; + 2628299215EC7196002C4240 /* cpSlideJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSlideJoint.h; sourceTree = ""; }; + 2628299315EC7196002C4240 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = ""; }; + 2628299415EC7196002C4240 /* cpArbiter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpArbiter.h; sourceTree = ""; }; + 2628299515EC7196002C4240 /* cpBB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpBB.h; sourceTree = ""; }; + 2628299615EC7196002C4240 /* cpBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpBody.h; sourceTree = ""; }; + 2628299715EC7196002C4240 /* cpPolyShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpPolyShape.h; sourceTree = ""; }; + 2628299815EC7196002C4240 /* cpShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpShape.h; sourceTree = ""; }; + 2628299915EC7196002C4240 /* cpSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSpace.h; sourceTree = ""; }; + 2628299A15EC7196002C4240 /* cpSpatialIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpSpatialIndex.h; sourceTree = ""; }; + 2628299B15EC7196002C4240 /* cpVect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpVect.h; sourceTree = ""; }; + 2628299C15EC7196002C4240 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; }; + 2628299E15EC7196002C4240 /* .cproject */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = .cproject; sourceTree = ""; }; + 2628299F15EC7196002C4240 /* .project */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = .project; sourceTree = ""; }; + 262829A115EC7196002C4240 /* .cproject */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = .cproject; sourceTree = ""; }; + 262829A215EC7196002C4240 /* .project */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = .project; sourceTree = ""; }; + 262829A315EC7196002C4240 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + 262829A515EC7196002C4240 /* chipmunk.vcproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = chipmunk.vcproj; sourceTree = ""; }; + 262829A615EC7196002C4240 /* chipmunk.vcproj.user */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = chipmunk.vcproj.user; sourceTree = ""; }; + 262829A715EC7196002C4240 /* chipmunk.vcxproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = chipmunk.vcxproj; sourceTree = ""; }; + 262829A815EC7196002C4240 /* chipmunk.vcxproj.filters */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = chipmunk.vcxproj.filters; sourceTree = ""; }; + 262829A915EC7196002C4240 /* chipmunk.vcxproj.user */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = chipmunk.vcxproj.user; sourceTree = ""; }; + 262829AA15EC7196002C4240 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = ""; }; + 262829AC15EC7196002C4240 /* chipmunk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = chipmunk.c; sourceTree = ""; }; + 262829AD15EC7196002C4240 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; + 262829AF15EC7196002C4240 /* cpConstraint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpConstraint.c; sourceTree = ""; }; + 262829B015EC7196002C4240 /* cpDampedRotarySpring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpDampedRotarySpring.c; sourceTree = ""; }; + 262829B115EC7196002C4240 /* cpDampedSpring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpDampedSpring.c; sourceTree = ""; }; + 262829B215EC7196002C4240 /* cpGearJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpGearJoint.c; sourceTree = ""; }; + 262829B315EC7196002C4240 /* cpGrooveJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpGrooveJoint.c; sourceTree = ""; }; + 262829B415EC7196002C4240 /* cpPinJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPinJoint.c; sourceTree = ""; }; + 262829B515EC7196002C4240 /* cpPivotJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPivotJoint.c; sourceTree = ""; }; + 262829B615EC7196002C4240 /* cpRatchetJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpRatchetJoint.c; sourceTree = ""; }; + 262829B715EC7196002C4240 /* cpRotaryLimitJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpRotaryLimitJoint.c; sourceTree = ""; }; + 262829B815EC7196002C4240 /* cpSimpleMotor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSimpleMotor.c; sourceTree = ""; }; + 262829B915EC7196002C4240 /* cpSlideJoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSlideJoint.c; sourceTree = ""; }; + 262829BA15EC7196002C4240 /* cpArbiter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpArbiter.c; sourceTree = ""; }; + 262829BB15EC7196002C4240 /* cpArray.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpArray.c; sourceTree = ""; }; + 262829BC15EC7196002C4240 /* cpBB.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBB.c; sourceTree = ""; }; + 262829BD15EC7196002C4240 /* cpBBTree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBBTree.c; sourceTree = ""; }; + 262829BE15EC7196002C4240 /* cpBody.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpBody.c; sourceTree = ""; }; + 262829BF15EC7196002C4240 /* cpCollision.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpCollision.c; sourceTree = ""; }; + 262829C015EC7196002C4240 /* cpHashSet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpHashSet.c; sourceTree = ""; }; + 262829C115EC7196002C4240 /* cpPolyShape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpPolyShape.c; sourceTree = ""; }; + 262829C215EC7196002C4240 /* cpShape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpShape.c; sourceTree = ""; }; + 262829C315EC7196002C4240 /* cpSpace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpace.c; sourceTree = ""; }; + 262829C415EC7196002C4240 /* cpSpaceComponent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceComponent.c; sourceTree = ""; }; + 262829C515EC7196002C4240 /* cpSpaceHash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceHash.c; sourceTree = ""; }; + 262829C615EC7196002C4240 /* cpSpaceQuery.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceQuery.c; sourceTree = ""; }; + 262829C715EC7196002C4240 /* cpSpaceStep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpaceStep.c; sourceTree = ""; }; + 262829C815EC7196002C4240 /* cpSpatialIndex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSpatialIndex.c; sourceTree = ""; }; + 262829C915EC7196002C4240 /* cpSweep1D.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpSweep1D.c; sourceTree = ""; }; + 262829CA15EC7196002C4240 /* cpVect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpVect.c; sourceTree = ""; }; + 262829CB15EC7196002C4240 /* prime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = ""; }; + A922753D1517C094001B78AA /* MoonWarriors.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MoonWarriors.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A92275411517C094001B78AA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + A92275431517C094001B78AA /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + A92275451517C094001B78AA /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + A92275471517C094001B78AA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + A92275491517C094001B78AA /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + A922754B1517C094001B78AA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + A922754D1517C094001B78AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + A922754F1517C094001B78AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + D446FDA216102D7D000ADA7B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + D446FDA416102D82000ADA7B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + D446FDA616102D86000ADA7B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + D45446CD156DE74F00887EB5 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; + D45446CE156DE74F00887EB5 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; + D45446CF156DE74F00887EB5 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + D45446D0156DE74F00887EB5 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; + D45446D1156DE74F00887EB5 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; + D45446D2156DE74F00887EB5 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = ""; }; + D45446D6156DE79D00887EB5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D4545209156E22B400887EB5 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; + D454520B156E22BD00887EB5 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + D4545215156E28EF00887EB5 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = ""; }; + D4545216156E28EF00887EB5 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + A922753A1517C094001B78AA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 15426FC315B5742200712A7F /* libcocos2dx.a in Frameworks */, + D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */, + D454520A156E22B400887EB5 /* libxml2.dylib in Frameworks */, + A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, + A92275441517C094001B78AA /* OpenGLES.framework in Frameworks */, + A92275461517C094001B78AA /* OpenAL.framework in Frameworks */, + A92275481517C094001B78AA /* AudioToolbox.framework in Frameworks */, + A922754A1517C094001B78AA /* AVFoundation.framework in Frameworks */, + A922754C1517C094001B78AA /* UIKit.framework in Frameworks */, + A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, + A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 15384E3C16119CC30021DC07 /* bindings */ = { + isa = PBXGroup; + children = ( + 15384E3E16119CC30021DC07 /* CCPhysicsSprite.cpp */, + 15384E3F16119CC30021DC07 /* CCPhysicsSprite.h */, + 15384E4016119CC30021DC07 /* cocos2d_specifics.cpp */, + 15384E4116119CC30021DC07 /* cocos2d_specifics.hpp */, + 15384E4216119CC30021DC07 /* cocosjs_manual_conversions.cpp */, + 15384E4316119CC30021DC07 /* cocosjs_manual_conversions.h */, + 15384E4416119CC30021DC07 /* generated */, + 15384E4916119CC30021DC07 /* js_bindings_ccbreader.cpp */, + 15384E4A16119CC30021DC07 /* js_bindings_ccbreader.h */, + 15384E4B16119CC30021DC07 /* js_bindings_chipmunk_functions.cpp */, + 15384E4C16119CC30021DC07 /* js_bindings_chipmunk_functions.hpp */, + 15384E4D16119CC30021DC07 /* js_bindings_chipmunk_manual.cpp */, + 15384E4E16119CC30021DC07 /* js_bindings_chipmunk_manual.hpp */, + 15384E4F16119CC30021DC07 /* js_bindings_config.h */, + 15384E5016119CC30021DC07 /* js_manual_conversions.cpp */, + 15384E5116119CC30021DC07 /* js_manual_conversions.h */, + 15384E5216119CC30021DC07 /* ScriptingCore.cpp */, + 15384E5316119CC30021DC07 /* ScriptingCore.h */, + 15384E5416119CC30021DC07 /* spidermonkey_specifics.h */, + 15384E5516119CC30021DC07 /* uthash.h */, + ); + name = bindings; + path = ../../../scripting/javascript/bindings; + sourceTree = ""; + }; + 15384E4416119CC30021DC07 /* generated */ = { + isa = PBXGroup; + children = ( + 15384E4516119CC30021DC07 /* cocos2dx.cpp */, + 15384E4616119CC30021DC07 /* cocos2dx.hpp */, + ); + path = generated; + sourceTree = ""; + }; + 15384E6216119D5E0021DC07 /* extensions */ = { + isa = PBXGroup; + children = ( + 15384E6416119D5E0021DC07 /* CCBReader */, + 15384E9916119D5E0021DC07 /* cocos-ext.h */, + 15384E9A16119D5E0021DC07 /* ExtensionMacros.h */, + 15384E9B16119D5E0021DC07 /* GUI */, + ); + name = extensions; + path = ../../../extensions; + sourceTree = ""; + }; + 15384E6416119D5E0021DC07 /* CCBReader */ = { + isa = PBXGroup; + children = ( + 15384E6516119D5E0021DC07 /* CCBAnimationManager.cpp */, + 15384E6616119D5E0021DC07 /* CCBAnimationManager.h */, + 15384E6716119D5E0021DC07 /* CCBFileLoader.cpp */, + 15384E6816119D5E0021DC07 /* CCBFileLoader.h */, + 15384E6916119D5E0021DC07 /* CCBKeyframe.cpp */, + 15384E6A16119D5E0021DC07 /* CCBKeyframe.h */, + 15384E6B16119D5E0021DC07 /* CCBMemberVariableAssigner.h */, + 15384E6C16119D5E0021DC07 /* CCBReader.cpp */, + 15384E6D16119D5E0021DC07 /* CCBReader.h */, + 15384E6E16119D5E0021DC07 /* CCBSelectorResolver.h */, + 15384E6F16119D5E0021DC07 /* CCBSequence.cpp */, + 15384E7016119D5E0021DC07 /* CCBSequence.h */, + 15384E7116119D5E0021DC07 /* CCBSequenceProperty.cpp */, + 15384E7216119D5E0021DC07 /* CCBSequenceProperty.h */, + 15384E7316119D5E0021DC07 /* CCBValue.cpp */, + 15384E7416119D5E0021DC07 /* CCBValue.h */, + 15384E7516119D5E0021DC07 /* CCControlButtonLoader.cpp */, + 15384E7616119D5E0021DC07 /* CCControlButtonLoader.h */, + 15384E7716119D5E0021DC07 /* CCControlLoader.cpp */, + 15384E7816119D5E0021DC07 /* CCControlLoader.h */, + 15384E7916119D5E0021DC07 /* CCData.cpp */, + 15384E7A16119D5E0021DC07 /* CCData.h */, + 15384E7B16119D5E0021DC07 /* CCLabelBMFontLoader.cpp */, + 15384E7C16119D5E0021DC07 /* CCLabelBMFontLoader.h */, + 15384E7D16119D5E0021DC07 /* CCLabelTTFLoader.cpp */, + 15384E7E16119D5E0021DC07 /* CCLabelTTFLoader.h */, + 15384E7F16119D5E0021DC07 /* CCLayerColorLoader.cpp */, + 15384E8016119D5E0021DC07 /* CCLayerColorLoader.h */, + 15384E8116119D5E0021DC07 /* CCLayerGradientLoader.cpp */, + 15384E8216119D5E0021DC07 /* CCLayerGradientLoader.h */, + 15384E8316119D5E0021DC07 /* CCLayerLoader.cpp */, + 15384E8416119D5E0021DC07 /* CCLayerLoader.h */, + 15384E8516119D5E0021DC07 /* CCMenuItemImageLoader.cpp */, + 15384E8616119D5E0021DC07 /* CCMenuItemImageLoader.h */, + 15384E8716119D5E0021DC07 /* CCMenuItemLoader.cpp */, + 15384E8816119D5E0021DC07 /* CCMenuItemLoader.h */, + 15384E8916119D5E0021DC07 /* CCMenuLoader.h */, + 15384E8A16119D5E0021DC07 /* CCNode+CCBRelativePositioning.cpp */, + 15384E8B16119D5E0021DC07 /* CCNode+CCBRelativePositioning.h */, + 15384E8C16119D5E0021DC07 /* CCNodeLoader.cpp */, + 15384E8D16119D5E0021DC07 /* CCNodeLoader.h */, + 15384E8E16119D5E0021DC07 /* CCNodeLoaderLibrary.cpp */, + 15384E8F16119D5E0021DC07 /* CCNodeLoaderLibrary.h */, + 15384E9016119D5E0021DC07 /* CCNodeLoaderListener.h */, + 15384E9116119D5E0021DC07 /* CCParticleSystemQuadLoader.cpp */, + 15384E9216119D5E0021DC07 /* CCParticleSystemQuadLoader.h */, + 15384E9316119D5E0021DC07 /* CCScale9SpriteLoader.cpp */, + 15384E9416119D5E0021DC07 /* CCScale9SpriteLoader.h */, + 15384E9516119D5E0021DC07 /* CCScrollViewLoader.cpp */, + 15384E9616119D5E0021DC07 /* CCScrollViewLoader.h */, + 15384E9716119D5E0021DC07 /* CCSpriteLoader.cpp */, + 15384E9816119D5E0021DC07 /* CCSpriteLoader.h */, + ); + path = CCBReader; + sourceTree = ""; + }; + 15384E9B16119D5E0021DC07 /* GUI */ = { + isa = PBXGroup; + children = ( + 15CFE18C1612FD0E00BF2188 /* CCControlExtension */, + 15384EB616119D5E0021DC07 /* CCEditBox */, + 15384EC016119D5E0021DC07 /* CCScrollView */, + ); + path = GUI; + sourceTree = ""; + }; + 15384EB616119D5E0021DC07 /* CCEditBox */ = { + isa = PBXGroup; + children = ( + 15384EB716119D5E0021DC07 /* CCEditBox.cpp */, + 15384EB816119D5E0021DC07 /* CCEditBox.h */, + 15384EB916119D5E0021DC07 /* CCEditBoxImpl.h */, + 15384EBC16119D5E0021DC07 /* CCEditBoxImplIOS.h */, + 15384EBD16119D5E0021DC07 /* CCEditBoxImplIOS.mm */, + 15384EBE16119D5E0021DC07 /* EditBoxImplIOS.h */, + 15384EBF16119D5E0021DC07 /* EditBoxImplIOS.mm */, + ); + path = CCEditBox; + sourceTree = ""; + }; + 15384EC016119D5E0021DC07 /* CCScrollView */ = { + isa = PBXGroup; + children = ( + 15384EC116119D5E0021DC07 /* CCScrollView.cpp */, + 15384EC216119D5E0021DC07 /* CCScrollView.h */, + 15384EC316119D5E0021DC07 /* CCSorting.cpp */, + 15384EC416119D5E0021DC07 /* CCSorting.h */, + 15384EC516119D5E0021DC07 /* CCTableView.cpp */, + 15384EC616119D5E0021DC07 /* CCTableView.h */, + 15384EC716119D5E0021DC07 /* CCTableViewCell.cpp */, + 15384EC816119D5E0021DC07 /* CCTableViewCell.h */, + ); + path = CCScrollView; + sourceTree = ""; + }; + 15426AEA15B5733200712A7F /* Products */ = { + isa = PBXGroup; + children = ( + 15426AF115B5733200712A7F /* libcocos2dx.a */, + ); + name = Products; + sourceTree = ""; + }; + 15426FC415B5743C00712A7F /* CocosDenshion */ = { + isa = PBXGroup; + children = ( + 15426FCB15B5743C00712A7F /* include */, + 15426FCE15B5743C00712A7F /* ios */, + ); + name = CocosDenshion; + path = ../../../CocosDenshion; + sourceTree = ""; + }; + 15426FCB15B5743C00712A7F /* include */ = { + isa = PBXGroup; + children = ( + 15426FCC15B5743C00712A7F /* Export.h */, + 15426FCD15B5743C00712A7F /* SimpleAudioEngine.h */, + ); + path = include; + sourceTree = ""; + }; + 15426FCE15B5743C00712A7F /* ios */ = { + isa = PBXGroup; + children = ( + 15426FCF15B5743C00712A7F /* CDAudioManager.h */, + 15426FD015B5743C00712A7F /* CDAudioManager.m */, + 15426FD115B5743C00712A7F /* CDConfig.h */, + 15426FD215B5743C00712A7F /* CDOpenALSupport.h */, + 15426FD315B5743C00712A7F /* CDOpenALSupport.m */, + 15426FD415B5743C00712A7F /* CocosDenshion.h */, + 15426FD515B5743C00712A7F /* CocosDenshion.m */, + 15426FD615B5743C00712A7F /* SimpleAudioEngine.mm */, + 15426FD715B5743C00712A7F /* SimpleAudioEngine_objc.h */, + 15426FD815B5743C00712A7F /* SimpleAudioEngine_objc.m */, + ); + path = ios; + sourceTree = ""; + }; + 15628F5B15F0F5C2000CF24B /* Resources */ = { + isa = PBXGroup; + children = ( + D446FDA616102D86000ADA7B /* Default-568h@2x.png */, + D446FDA416102D82000ADA7B /* Default@2x.png */, + D446FDA216102D7D000ADA7B /* Default.png */, + 15628FA815F1057E000CF24B /* animations */, + 15628F5D15F0F5E5000CF24B /* ballbounce.wav */, + 15628F5E15F0F5E5000CF24B /* cowbell.wav */, + 15628F5F15F0F5E5000CF24B /* Cyber Advance!.mp3 */, + 15628F6015F0F5E5000CF24B /* Fonts */, + 15628F6115F0F5E5000CF24B /* Images */, + 15628F6215F0F5E5000CF24B /* js */, + 15628F6315F0F5E5000CF24B /* oldjs */, + 15628F6415F0F5E5000CF24B /* Particles */, + 15628F6515F0F5E5000CF24B /* Silly Fun Theme A.mp3 */, + 15628F6615F0F5E5000CF24B /* tank.plist */, + 15628F6715F0F5E5000CF24B /* tank.png */, + 15628F6815F0F5E5000CF24B /* tank.tps */, + 15628F6915F0F5E5000CF24B /* tank1.png */, + 15628F6A15F0F5E5000CF24B /* TileMaps */, + ); + name = Resources; + sourceTree = ""; + }; + 15CFE18C1612FD0E00BF2188 /* CCControlExtension */ = { + isa = PBXGroup; + children = ( + 15CFE18D1612FD0E00BF2188 /* CCControl.cpp */, + 15CFE18E1612FD0E00BF2188 /* CCControl.h */, + 15CFE18F1612FD0E00BF2188 /* CCControlButton.cpp */, + 15CFE1901612FD0E00BF2188 /* CCControlButton.h */, + 15CFE1911612FD0E00BF2188 /* CCControlColourPicker.cpp */, + 15CFE1921612FD0E00BF2188 /* CCControlColourPicker.h */, + 15CFE1931612FD0E00BF2188 /* CCControlExtensions.h */, + 15CFE1941612FD0E00BF2188 /* CCControlHuePicker.cpp */, + 15CFE1951612FD0E00BF2188 /* CCControlHuePicker.h */, + 15CFE1961612FD0E00BF2188 /* CCControlPotentiometer.cpp */, + 15CFE1971612FD0E00BF2188 /* CCControlPotentiometer.h */, + 15CFE1981612FD0E00BF2188 /* CCControlSaturationBrightnessPicker.cpp */, + 15CFE1991612FD0E00BF2188 /* CCControlSaturationBrightnessPicker.h */, + 15CFE19A1612FD0E00BF2188 /* CCControlSlider.cpp */, + 15CFE19B1612FD0E00BF2188 /* CCControlSlider.h */, + 15CFE19C1612FD0E00BF2188 /* CCControlStepper.cpp */, + 15CFE19D1612FD0E00BF2188 /* CCControlStepper.h */, + 15CFE19E1612FD0E00BF2188 /* CCControlSwitch.cpp */, + 15CFE19F1612FD0E00BF2188 /* CCControlSwitch.h */, + 15CFE1A01612FD0E00BF2188 /* CCControlUtils.cpp */, + 15CFE1A11612FD0E00BF2188 /* CCControlUtils.h */, + 15CFE1A21612FD0E00BF2188 /* CCInvocation.cpp */, + 15CFE1A31612FD0E00BF2188 /* CCInvocation.h */, + 15CFE1A41612FD0E00BF2188 /* CCScale9Sprite.cpp */, + 15CFE1A51612FD0E00BF2188 /* CCScale9Sprite.h */, + ); + path = CCControlExtension; + sourceTree = ""; + }; + 2628297C15EC7196002C4240 /* chipmunk */ = { + isa = PBXGroup; + children = ( + 2628297D15EC7196002C4240 /* .gitignore */, + 2628297E15EC7196002C4240 /* Android.mk */, + 2628297F15EC7196002C4240 /* chipmunk-docs.html */, + 2628298015EC7196002C4240 /* include */, + 2628299C15EC7196002C4240 /* LICENSE.txt */, + 2628299D15EC7196002C4240 /* proj.blackberry */, + 262829A015EC7196002C4240 /* proj.linux */, + 262829A415EC7196002C4240 /* proj.win32 */, + 262829AA15EC7196002C4240 /* README.txt */, + 262829AB15EC7196002C4240 /* src */, + ); + name = chipmunk; + path = ../../../external/chipmunk; + sourceTree = ""; + }; + 2628298015EC7196002C4240 /* include */ = { + isa = PBXGroup; + children = ( + 2628298115EC7196002C4240 /* chipmunk */, + ); + path = include; + sourceTree = ""; + }; + 2628298115EC7196002C4240 /* chipmunk */ = { + isa = PBXGroup; + children = ( + 2628298215EC7196002C4240 /* chipmunk.h */, + 2628298315EC7196002C4240 /* chipmunk_ffi.h */, + 2628298415EC7196002C4240 /* chipmunk_private.h */, + 2628298515EC7196002C4240 /* chipmunk_types.h */, + 2628298615EC7196002C4240 /* chipmunk_unsafe.h */, + 2628298715EC7196002C4240 /* constraints */, + 2628299415EC7196002C4240 /* cpArbiter.h */, + 2628299515EC7196002C4240 /* cpBB.h */, + 2628299615EC7196002C4240 /* cpBody.h */, + 2628299715EC7196002C4240 /* cpPolyShape.h */, + 2628299815EC7196002C4240 /* cpShape.h */, + 2628299915EC7196002C4240 /* cpSpace.h */, + 2628299A15EC7196002C4240 /* cpSpatialIndex.h */, + 2628299B15EC7196002C4240 /* cpVect.h */, + ); + path = chipmunk; + sourceTree = ""; + }; + 2628298715EC7196002C4240 /* constraints */ = { + isa = PBXGroup; + children = ( + 2628298815EC7196002C4240 /* cpConstraint.h */, + 2628298915EC7196002C4240 /* cpDampedRotarySpring.h */, + 2628298A15EC7196002C4240 /* cpDampedSpring.h */, + 2628298B15EC7196002C4240 /* cpGearJoint.h */, + 2628298C15EC7196002C4240 /* cpGrooveJoint.h */, + 2628298D15EC7196002C4240 /* cpPinJoint.h */, + 2628298E15EC7196002C4240 /* cpPivotJoint.h */, + 2628298F15EC7196002C4240 /* cpRatchetJoint.h */, + 2628299015EC7196002C4240 /* cpRotaryLimitJoint.h */, + 2628299115EC7196002C4240 /* cpSimpleMotor.h */, + 2628299215EC7196002C4240 /* cpSlideJoint.h */, + 2628299315EC7196002C4240 /* util.h */, + ); + path = constraints; + sourceTree = ""; + }; + 2628299D15EC7196002C4240 /* proj.blackberry */ = { + isa = PBXGroup; + children = ( + 2628299E15EC7196002C4240 /* .cproject */, + 2628299F15EC7196002C4240 /* .project */, + ); + path = proj.blackberry; + sourceTree = ""; + }; + 262829A015EC7196002C4240 /* proj.linux */ = { + isa = PBXGroup; + children = ( + 262829A115EC7196002C4240 /* .cproject */, + 262829A215EC7196002C4240 /* .project */, + 262829A315EC7196002C4240 /* Makefile */, + ); + path = proj.linux; + sourceTree = ""; + }; + 262829A415EC7196002C4240 /* proj.win32 */ = { + isa = PBXGroup; + children = ( + 262829A515EC7196002C4240 /* chipmunk.vcproj */, + 262829A615EC7196002C4240 /* chipmunk.vcproj.user */, + 262829A715EC7196002C4240 /* chipmunk.vcxproj */, + 262829A815EC7196002C4240 /* chipmunk.vcxproj.filters */, + 262829A915EC7196002C4240 /* chipmunk.vcxproj.user */, + ); + path = proj.win32; + sourceTree = ""; + }; + 262829AB15EC7196002C4240 /* src */ = { + isa = PBXGroup; + children = ( + 262829AC15EC7196002C4240 /* chipmunk.c */, + 262829AD15EC7196002C4240 /* CMakeLists.txt */, + 262829AE15EC7196002C4240 /* constraints */, + 262829BA15EC7196002C4240 /* cpArbiter.c */, + 262829BB15EC7196002C4240 /* cpArray.c */, + 262829BC15EC7196002C4240 /* cpBB.c */, + 262829BD15EC7196002C4240 /* cpBBTree.c */, + 262829BE15EC7196002C4240 /* cpBody.c */, + 262829BF15EC7196002C4240 /* cpCollision.c */, + 262829C015EC7196002C4240 /* cpHashSet.c */, + 262829C115EC7196002C4240 /* cpPolyShape.c */, + 262829C215EC7196002C4240 /* cpShape.c */, + 262829C315EC7196002C4240 /* cpSpace.c */, + 262829C415EC7196002C4240 /* cpSpaceComponent.c */, + 262829C515EC7196002C4240 /* cpSpaceHash.c */, + 262829C615EC7196002C4240 /* cpSpaceQuery.c */, + 262829C715EC7196002C4240 /* cpSpaceStep.c */, + 262829C815EC7196002C4240 /* cpSpatialIndex.c */, + 262829C915EC7196002C4240 /* cpSweep1D.c */, + 262829CA15EC7196002C4240 /* cpVect.c */, + 262829CB15EC7196002C4240 /* prime.h */, + ); + path = src; + sourceTree = ""; + }; + 262829AE15EC7196002C4240 /* constraints */ = { + isa = PBXGroup; + children = ( + 262829AF15EC7196002C4240 /* cpConstraint.c */, + 262829B015EC7196002C4240 /* cpDampedRotarySpring.c */, + 262829B115EC7196002C4240 /* cpDampedSpring.c */, + 262829B215EC7196002C4240 /* cpGearJoint.c */, + 262829B315EC7196002C4240 /* cpGrooveJoint.c */, + 262829B415EC7196002C4240 /* cpPinJoint.c */, + 262829B515EC7196002C4240 /* cpPivotJoint.c */, + 262829B615EC7196002C4240 /* cpRatchetJoint.c */, + 262829B715EC7196002C4240 /* cpRotaryLimitJoint.c */, + 262829B815EC7196002C4240 /* cpSimpleMotor.c */, + 262829B915EC7196002C4240 /* cpSlideJoint.c */, + ); + path = constraints; + sourceTree = ""; + }; + A92275321517C094001B78AA = { + isa = PBXGroup; + children = ( + 15384E6216119D5E0021DC07 /* extensions */, + 15384E3C16119CC30021DC07 /* bindings */, + 15426AE915B5733200712A7F /* cocos2dx.xcodeproj */, + 15628F5B15F0F5C2000CF24B /* Resources */, + 2628297C15EC7196002C4240 /* chipmunk */, + D4545214156E28EF00887EB5 /* Classes */, + 15426FC415B5743C00712A7F /* CocosDenshion */, + A92275401517C094001B78AA /* Frameworks */, + D45446CC156DE73F00887EB5 /* ios */, + A922753E1517C094001B78AA /* Products */, + ); + sourceTree = ""; + }; + A922753E1517C094001B78AA /* Products */ = { + isa = PBXGroup; + children = ( + A922753D1517C094001B78AA /* MoonWarriors.app */, + ); + name = Products; + sourceTree = ""; + }; + A92275401517C094001B78AA /* Frameworks */ = { + isa = PBXGroup; + children = ( + D454520B156E22BD00887EB5 /* libz.dylib */, + D4545209156E22B400887EB5 /* libxml2.dylib */, + A92275411517C094001B78AA /* QuartzCore.framework */, + A92275431517C094001B78AA /* OpenGLES.framework */, + A92275451517C094001B78AA /* OpenAL.framework */, + A92275471517C094001B78AA /* AudioToolbox.framework */, + A92275491517C094001B78AA /* AVFoundation.framework */, + A922754B1517C094001B78AA /* UIKit.framework */, + A922754D1517C094001B78AA /* Foundation.framework */, + A922754F1517C094001B78AA /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + D45446CC156DE73F00887EB5 /* ios */ = { + isa = PBXGroup; + children = ( + D45446D6156DE79D00887EB5 /* Info.plist */, + D45446CD156DE74F00887EB5 /* AppController.h */, + D45446CE156DE74F00887EB5 /* AppController.mm */, + D45446CF156DE74F00887EB5 /* main.m */, + D45446D0156DE74F00887EB5 /* Prefix.pch */, + D45446D1156DE74F00887EB5 /* RootViewController.h */, + D45446D2156DE74F00887EB5 /* RootViewController.mm */, + ); + name = ios; + sourceTree = ""; + }; + D4545214156E28EF00887EB5 /* Classes */ = { + isa = PBXGroup; + children = ( + D4545215156E28EF00887EB5 /* AppDelegate.cpp */, + D4545216156E28EF00887EB5 /* AppDelegate.h */, + ); + name = Classes; + path = ../Classes; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + A922753C1517C094001B78AA /* MoonWarriors */ = { + isa = PBXNativeTarget; + buildConfigurationList = A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "MoonWarriors" */; + buildPhases = ( + A92275391517C094001B78AA /* Sources */, + A922753A1517C094001B78AA /* Frameworks */, + A922753B1517C094001B78AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 15426FC215B5741900712A7F /* PBXTargetDependency */, + ); + name = MoonWarriors; + productName = MoonWarriors; + productReference = A922753D1517C094001B78AA /* MoonWarriors.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + A92275341517C094001B78AA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; + buildConfigurationList = A92275371517C094001B78AA /* Build configuration list for PBXProject "MoonWarriors" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = A92275321517C094001B78AA; + productRefGroup = A922753E1517C094001B78AA /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 15426AEA15B5733200712A7F /* Products */; + ProjectRef = 15426AE915B5733200712A7F /* cocos2dx.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + A922753C1517C094001B78AA /* MoonWarriors */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 15426AF115B5733200712A7F /* libcocos2dx.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcocos2dx.a; + remoteRef = 15426AF015B5733200712A7F /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + A922753B1517C094001B78AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 262829CC15EC7196002C4240 /* .gitignore in Resources */, + 262829CD15EC7196002C4240 /* Android.mk in Resources */, + 262829CE15EC7196002C4240 /* chipmunk-docs.html in Resources */, + 262829CF15EC7196002C4240 /* LICENSE.txt in Resources */, + 262829D015EC7196002C4240 /* .cproject in Resources */, + 262829D115EC7196002C4240 /* .project in Resources */, + 262829D215EC7196002C4240 /* .cproject in Resources */, + 262829D315EC7196002C4240 /* .project in Resources */, + 262829D515EC7196002C4240 /* chipmunk.vcproj in Resources */, + 262829D615EC7196002C4240 /* chipmunk.vcproj.user in Resources */, + 262829D715EC7196002C4240 /* chipmunk.vcxproj in Resources */, + 262829D815EC7196002C4240 /* chipmunk.vcxproj.filters in Resources */, + 262829D915EC7196002C4240 /* chipmunk.vcxproj.user in Resources */, + 262829DA15EC7196002C4240 /* README.txt in Resources */, + 262829DC15EC7196002C4240 /* CMakeLists.txt in Resources */, + 15628F6C15F0F5E5000CF24B /* ballbounce.wav in Resources */, + 15628F6D15F0F5E5000CF24B /* cowbell.wav in Resources */, + 15628F6E15F0F5E5000CF24B /* Cyber Advance!.mp3 in Resources */, + 15628F6F15F0F5E5000CF24B /* Fonts in Resources */, + 15628F7015F0F5E5000CF24B /* Images in Resources */, + 15628F7115F0F5E5000CF24B /* js in Resources */, + 15628F7215F0F5E5000CF24B /* oldjs in Resources */, + 15628F7315F0F5E5000CF24B /* Particles in Resources */, + 15628F7415F0F5E5000CF24B /* Silly Fun Theme A.mp3 in Resources */, + 15628F7515F0F5E5000CF24B /* tank.plist in Resources */, + 15628F7615F0F5E5000CF24B /* tank.png in Resources */, + 15628F7715F0F5E5000CF24B /* tank.tps in Resources */, + 15628F7815F0F5E5000CF24B /* tank1.png in Resources */, + 15628F7915F0F5E5000CF24B /* TileMaps in Resources */, + 15628FA915F1057E000CF24B /* animations in Resources */, + D446FDA316102D7D000ADA7B /* Default.png in Resources */, + D446FDA516102D82000ADA7B /* Default@2x.png in Resources */, + D446FDA716102D86000ADA7B /* Default-568h@2x.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A92275391517C094001B78AA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D45446D3156DE74F00887EB5 /* AppController.mm in Sources */, + D45446D4156DE74F00887EB5 /* main.m in Sources */, + D45446D5156DE74F00887EB5 /* RootViewController.mm in Sources */, + D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */, + 15426FE615B5743C00712A7F /* CDAudioManager.m in Sources */, + 15426FE715B5743C00712A7F /* CDOpenALSupport.m in Sources */, + 15426FE815B5743C00712A7F /* CocosDenshion.m in Sources */, + 15426FE915B5743C00712A7F /* SimpleAudioEngine.mm in Sources */, + 15426FEA15B5743C00712A7F /* SimpleAudioEngine_objc.m in Sources */, + 262829D415EC7196002C4240 /* Makefile in Sources */, + 262829DB15EC7196002C4240 /* chipmunk.c in Sources */, + 262829DD15EC7196002C4240 /* cpConstraint.c in Sources */, + 262829DE15EC7196002C4240 /* cpDampedRotarySpring.c in Sources */, + 262829DF15EC7196002C4240 /* cpDampedSpring.c in Sources */, + 262829E015EC7196002C4240 /* cpGearJoint.c in Sources */, + 262829E115EC7196002C4240 /* cpGrooveJoint.c in Sources */, + 262829E215EC7196002C4240 /* cpPinJoint.c in Sources */, + 262829E315EC7196002C4240 /* cpPivotJoint.c in Sources */, + 262829E415EC7196002C4240 /* cpRatchetJoint.c in Sources */, + 262829E515EC7196002C4240 /* cpRotaryLimitJoint.c in Sources */, + 262829E615EC7196002C4240 /* cpSimpleMotor.c in Sources */, + 262829E715EC7196002C4240 /* cpSlideJoint.c in Sources */, + 262829E815EC7196002C4240 /* cpArbiter.c in Sources */, + 262829E915EC7196002C4240 /* cpArray.c in Sources */, + 262829EA15EC7196002C4240 /* cpBB.c in Sources */, + 262829EB15EC7196002C4240 /* cpBBTree.c in Sources */, + 262829EC15EC7196002C4240 /* cpBody.c in Sources */, + 262829ED15EC7196002C4240 /* cpCollision.c in Sources */, + 262829EE15EC7196002C4240 /* cpHashSet.c in Sources */, + 262829EF15EC7196002C4240 /* cpPolyShape.c in Sources */, + 262829F015EC7196002C4240 /* cpShape.c in Sources */, + 262829F115EC7196002C4240 /* cpSpace.c in Sources */, + 262829F215EC7196002C4240 /* cpSpaceComponent.c in Sources */, + 262829F315EC7196002C4240 /* cpSpaceHash.c in Sources */, + 262829F415EC7196002C4240 /* cpSpaceQuery.c in Sources */, + 262829F515EC7196002C4240 /* cpSpaceStep.c in Sources */, + 262829F615EC7196002C4240 /* cpSpatialIndex.c in Sources */, + 262829F715EC7196002C4240 /* cpSweep1D.c in Sources */, + 262829F815EC7196002C4240 /* cpVect.c in Sources */, + 15384E5716119CC30021DC07 /* CCPhysicsSprite.cpp in Sources */, + 15384E5816119CC30021DC07 /* cocos2d_specifics.cpp in Sources */, + 15384E5916119CC30021DC07 /* cocosjs_manual_conversions.cpp in Sources */, + 15384E5A16119CC30021DC07 /* cocos2dx.cpp in Sources */, + 15384E5D16119CC30021DC07 /* js_bindings_ccbreader.cpp in Sources */, + 15384E5E16119CC30021DC07 /* js_bindings_chipmunk_functions.cpp in Sources */, + 15384E5F16119CC30021DC07 /* js_bindings_chipmunk_manual.cpp in Sources */, + 15384E6016119CC30021DC07 /* js_manual_conversions.cpp in Sources */, + 15384E6116119CC30021DC07 /* ScriptingCore.cpp in Sources */, + 15384ED716119D5E0021DC07 /* CCBAnimationManager.cpp in Sources */, + 15384ED816119D5E0021DC07 /* CCBFileLoader.cpp in Sources */, + 15384ED916119D5E0021DC07 /* CCBKeyframe.cpp in Sources */, + 15384EDA16119D5E0021DC07 /* CCBReader.cpp in Sources */, + 15384EDB16119D5E0021DC07 /* CCBSequence.cpp in Sources */, + 15384EDC16119D5E0021DC07 /* CCBSequenceProperty.cpp in Sources */, + 15384EDD16119D5E0021DC07 /* CCBValue.cpp in Sources */, + 15384EDE16119D5E0021DC07 /* CCControlButtonLoader.cpp in Sources */, + 15384EDF16119D5E0021DC07 /* CCControlLoader.cpp in Sources */, + 15384EE016119D5E0021DC07 /* CCData.cpp in Sources */, + 15384EE116119D5E0021DC07 /* CCLabelBMFontLoader.cpp in Sources */, + 15384EE216119D5E0021DC07 /* CCLabelTTFLoader.cpp in Sources */, + 15384EE316119D5E0021DC07 /* CCLayerColorLoader.cpp in Sources */, + 15384EE416119D5E0021DC07 /* CCLayerGradientLoader.cpp in Sources */, + 15384EE516119D5E0021DC07 /* CCLayerLoader.cpp in Sources */, + 15384EE616119D5E0021DC07 /* CCMenuItemImageLoader.cpp in Sources */, + 15384EE716119D5E0021DC07 /* CCMenuItemLoader.cpp in Sources */, + 15384EE816119D5E0021DC07 /* CCNode+CCBRelativePositioning.cpp in Sources */, + 15384EE916119D5E0021DC07 /* CCNodeLoader.cpp in Sources */, + 15384EEA16119D5E0021DC07 /* CCNodeLoaderLibrary.cpp in Sources */, + 15384EEB16119D5E0021DC07 /* CCParticleSystemQuadLoader.cpp in Sources */, + 15384EEC16119D5E0021DC07 /* CCScale9SpriteLoader.cpp in Sources */, + 15384EED16119D5E0021DC07 /* CCScrollViewLoader.cpp in Sources */, + 15384EEE16119D5E0021DC07 /* CCSpriteLoader.cpp in Sources */, + 15384EFB16119D5E0021DC07 /* CCEditBox.cpp in Sources */, + 15384EFD16119D5E0021DC07 /* CCEditBoxImplIOS.mm in Sources */, + 15384EFE16119D5E0021DC07 /* EditBoxImplIOS.mm in Sources */, + 15384EFF16119D5E0021DC07 /* CCScrollView.cpp in Sources */, + 15384F0016119D5E0021DC07 /* CCSorting.cpp in Sources */, + 15384F0116119D5E0021DC07 /* CCTableView.cpp in Sources */, + 15384F0216119D5E0021DC07 /* CCTableViewCell.cpp in Sources */, + 15CFE1A61612FD0E00BF2188 /* CCControl.cpp in Sources */, + 15CFE1A71612FD0E00BF2188 /* CCControlButton.cpp in Sources */, + 15CFE1A81612FD0E00BF2188 /* CCControlColourPicker.cpp in Sources */, + 15CFE1A91612FD0E00BF2188 /* CCControlHuePicker.cpp in Sources */, + 15CFE1AA1612FD0E00BF2188 /* CCControlPotentiometer.cpp in Sources */, + 15CFE1AB1612FD0E00BF2188 /* CCControlSaturationBrightnessPicker.cpp in Sources */, + 15CFE1AC1612FD0E00BF2188 /* CCControlSlider.cpp in Sources */, + 15CFE1AD1612FD0E00BF2188 /* CCControlStepper.cpp in Sources */, + 15CFE1AE1612FD0E00BF2188 /* CCControlSwitch.cpp in Sources */, + 15CFE1AF1612FD0E00BF2188 /* CCControlUtils.cpp in Sources */, + 15CFE1B01612FD0E00BF2188 /* CCInvocation.cpp in Sources */, + 15CFE1B11612FD0E00BF2188 /* CCScale9Sprite.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 15426FC215B5741900712A7F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = cocos2dx; + targetProxy = 15426FC115B5741900712A7F /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + A92276FE1517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + DEBUG, + "COCOS2D_DEBUG=1", + USE_FILE32API, + TARGET_OS_IPHONE, + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../../cocos2dx", + "$(SRCROOT)/../../../cocos2dx/include", + "$(SRCROOT)/../../../cocos2dx/platform/ios", + "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include1", + ); + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + SDKROOT = iphoneos; + }; + name = Debug; + }; + A92276FF1517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + NDEBUG, + USE_FILE32API, + TARGET_OS_IPHONE, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../../cocos2dx", + "$(SRCROOT)/../../../cocos2dx/include", + "$(SRCROOT)/../../../cocos2dx/platform/ios", + "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include1", + ); + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + }; + name = Release; + }; + A92277011517C097001B78AA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + COCOS2D_JAVASCRIPT, + DEBUG, + "COCOS2D_DEBUG=1", + USE_FILE32API, + TARGET_OS_IPHONE, + ); + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../../cocos2dx\"", + "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", + "\"$(SRCROOT)/../../../CocosDenshion/include\"", + "\"$(SDKROOT)/usr/include/libxml2\"", + "$(SRCROOT)/../../../cocos2dx/include", + "$(SRCROOT)/../../../cocos2dx/platform/ios", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include", + "$(SRCROOT)/../../../scripting/javascript/bindings", + ); + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/lib\""; + OTHER_LDFLAGS = ( + "-lxml2", + "-lz", + "-ljs_static", + ); + PRODUCT_NAME = MoonWarriors; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + A92277021517C097001B78AA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + COCOS2D_JAVASCRIPT, + NDEBUG, + USE_FILE32API, + TARGET_OS_IPHONE, + ); + "GCC_THUMB_SUPPORT[arch=armv6]" = ""; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../../cocos2dx\"", + "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", + "\"$(SRCROOT)/../../../CocosDenshion/include\"", + "\"$(SDKROOT)/usr/include/libxml2\"", + "$(SRCROOT)/../../../cocos2dx/include", + "$(SRCROOT)/../../../cocos2dx/platform/ios", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include", + "$(SRCROOT)/../../../scripting/javascript/bindings", + ); + INFOPLIST_FILE = Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/lib\""; + OTHER_LDFLAGS = ( + "-lxml2", + "-lz", + "-ljs_static", + ); + PRODUCT_NAME = MoonWarriors; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + A92275371517C094001B78AA /* Build configuration list for PBXProject "MoonWarriors" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92276FE1517C097001B78AA /* Debug */, + A92276FF1517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A92277001517C097001B78AA /* Build configuration list for PBXNativeTarget "MoonWarriors" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A92277011517C097001B78AA /* Debug */, + A92277021517C097001B78AA /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = A92275341517C094001B78AA /* Project object */; +} diff --git a/samples/MoonWarriors/proj.ios/Prefix.pch b/samples/MoonWarriors/proj.ios/Prefix.pch new file mode 100644 index 0000000000..b056d8694a --- /dev/null +++ b/samples/MoonWarriors/proj.ios/Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'testjs' target in the 'testjs' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/samples/MoonWarriors/proj.ios/RootViewController.h b/samples/MoonWarriors/proj.ios/RootViewController.h new file mode 100644 index 0000000000..a40c2edd28 --- /dev/null +++ b/samples/MoonWarriors/proj.ios/RootViewController.h @@ -0,0 +1,33 @@ +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + + +@interface RootViewController : UIViewController { + +} + +@end diff --git a/samples/MoonWarriors/proj.ios/RootViewController.mm b/samples/MoonWarriors/proj.ios/RootViewController.mm new file mode 100644 index 0000000000..7a0d59ccc9 --- /dev/null +++ b/samples/MoonWarriors/proj.ios/RootViewController.mm @@ -0,0 +1,73 @@ +// +// testjsAppController.h +// testjs +// +// Created by Rolando Abarca on 3/19/12. +// Copyright __MyCompanyName__ 2012. All rights reserved. +// + +#import "RootViewController.h" + + +@implementation RootViewController + +/* + // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + // Custom initialization + } + return self; +} +*/ + +/* +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView { +} +*/ + +/* +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad { + [super viewDidLoad]; +} + +*/ +// Override to allow orientations other than the default portrait orientation. +// This method is deprecated on ios6 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return UIInterfaceOrientationIsLandscape( interfaceOrientation ); +} + +// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead +- (NSUInteger) supportedInterfaceOrientations{ +#ifdef __IPHONE_6_0 + return UIInterfaceOrientationMaskAllButUpsideDown; +#endif +} + +- (BOOL) shouldAutorotate { + return YES; +} + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end diff --git a/samples/MoonWarriors/proj.ios/main.m b/samples/MoonWarriors/proj.ios/main.m new file mode 100644 index 0000000000..e3dedca28b --- /dev/null +++ b/samples/MoonWarriors/proj.ios/main.m @@ -0,0 +1,17 @@ +// +// main.m +// testjs +// +// Created by Rolando Abarca on 3/19/12. +// Copyright __MyCompanyName__ 2012. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); + [pool release]; + return retVal; +} diff --git a/samples/MoonWarriors/proj.win32/MoonWarriors.vcproj b/samples/MoonWarriors/proj.win32/MoonWarriors.vcproj new file mode 100644 index 0000000000..ea77235a92 --- /dev/null +++ b/samples/MoonWarriors/proj.win32/MoonWarriors.vcproj @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/MoonWarriors/proj.win32/TestJavascript.vcproj.user b/samples/MoonWarriors/proj.win32/TestJavascript.vcproj.user new file mode 100644 index 0000000000..eb4c2b142b --- /dev/null +++ b/samples/MoonWarriors/proj.win32/TestJavascript.vcproj.user @@ -0,0 +1,23 @@ + + + + + + + + + + + diff --git a/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj b/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj new file mode 100644 index 0000000000..e1d6d76865 --- /dev/null +++ b/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj @@ -0,0 +1,186 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D0F06A44-A245-4D13-A498-0120C203B539} + MoonWarriors + + + + Application + Unicode + + + Application + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + $(SolutionDir)$(Configuration).win32\ + $(Configuration).win32\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + _DEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)testjs.tlb + testjs.h + + + testjs_i.c + testjs_p.c + + + Disabled + .;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)extensions;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + 4267;4251;4244;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + if not exist "$(OutDir)" mkdir "$(OutDir)" +xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(OutDir)" + + + + libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies) + $(OutDir);%(AdditionalLibraryDirectories) + true + Windows + MachineX86 + + + + + NDEBUG;%(PreprocessorDefinitions) + false + Win32 + true + $(IntDir)testjs.tlb + testjs.h + + + testjs_i.c + testjs_p.c + + + .;..\Classes;$(SolutionDir)scripting\javascript\spidermonkey-win32\include;$(SolutionDir)external\chipmunk\include\chipmunk;$(SolutionDir)scripting\javascript\bindings;$(SolutionDir)extensions;$(SolutionDir)cocos2dx;$(SolutionDir)cocos2dx\include;$(SolutionDir)cocos2dx\kazmath\include;$(SolutionDir)cocos2dx\platform\win32;$(SolutionDir)cocos2dx\platform\third_party\win32;$(SolutionDir)cocos2dx\platform\third_party\win32\OGLES;$(SolutionDir)CocosDenshion\include;%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + MultiThreadedDLL + + + Level3 + + + 4267;4251;4244;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + if not exist "$(OutDir)" mkdir "$(OutDir)" +xcopy /Y /Q "$(SolutionDir)scripting\javascript\spidermonkey-win32\lib\*.*" "$(OutDir)" + + + + libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;%(AdditionalDependencies) + $(OutDir);%(AdditionalLibraryDirectories) + Windows + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {98a51ba8-fc3a-415b-ac8f-8c7bd464e93e} + false + + + {f8edd7fa-9a51-4e80-baeb-860825d2eac6} + false + + + + + + \ No newline at end of file diff --git a/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.filters b/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.filters new file mode 100644 index 0000000000..93bc5303f2 --- /dev/null +++ b/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.filters @@ -0,0 +1,110 @@ + + + + + {58ebb5df-595d-4e27-8c01-555be6f1c625} + + + {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest + + + {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} + + + {e93a77e1-af1e-4400-87d3-504b62ebdbb0} + + + {146f26cf-13e1-4106-891b-4b0118ceac2b} + + + + + win32 + + + Classes + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings\generated + + + + + win32 + + + win32 + + + Classes + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings + + + bindings\generated + + + + + resource + + + + + resource + + + \ No newline at end of file diff --git a/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.user b/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.user new file mode 100644 index 0000000000..314a27ae4d --- /dev/null +++ b/samples/MoonWarriors/proj.win32/TestJavascript.vcxproj.user @@ -0,0 +1,11 @@ + + + + $(ProjectDir)..\Resources + WindowsLocalDebugger + + + $(ProjectDir)..\Resources + WindowsLocalDebugger + + \ No newline at end of file diff --git a/samples/MoonWarriors/proj.win32/main.cpp b/samples/MoonWarriors/proj.win32/main.cpp new file mode 100644 index 0000000000..6a84a0be6e --- /dev/null +++ b/samples/MoonWarriors/proj.win32/main.cpp @@ -0,0 +1,37 @@ +#include "main.h" +#include "AppDelegate.h" +#include "CCEGLView.h" + +USING_NS_CC; + +// uncomment below line, open debug console +// #define USE_WIN32_CONSOLE + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + +#ifdef USE_WIN32_CONSOLE + AllocConsole(); + freopen("CONIN$", "r", stdin); + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); +#endif + + // create the application instance + AppDelegate app; + CCEGLView* eglView = CCEGLView::sharedOpenGLView(); + eglView->setFrameSize(320, 480); + + int ret = CCApplication::sharedApplication()->run(); + +#ifdef USE_WIN32_CONSOLE + FreeConsole(); +#endif + + return ret; +} diff --git a/samples/MoonWarriors/proj.win32/main.h b/samples/MoonWarriors/proj.win32/main.h new file mode 100644 index 0000000000..abe1c3a007 --- /dev/null +++ b/samples/MoonWarriors/proj.win32/main.h @@ -0,0 +1,13 @@ +#ifndef __MAIN_H__ +#define __MAIN_H__ + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +// Windows Header Files: +#include +#include + +// C RunTime Header Files +#include "CCStdC.h" + +#endif // __WINMAIN_H__ diff --git a/samples/MoonWarriors/proj.win32/res/testjs.ico b/samples/MoonWarriors/proj.win32/res/testjs.ico new file mode 100644 index 0000000000000000000000000000000000000000..feaf932a7465e435af6271bd8204c0145731a6eb GIT binary patch literal 47629 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 B$+`dl literal 0 HcmV?d00001 diff --git a/samples/TestJavascript/Resources/MoonWarriors/res/b01.png.REMOVED.git-id b/samples/TestJavascript/Resources/MoonWarriors/res/b01.png.REMOVED.git-id new file mode 100644 index 0000000000..ab880f0157 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/res/b01.png.REMOVED.git-id @@ -0,0 +1 @@ +46f10a6bf5c63f03ddf8566f392aa7a8f258d7e8 \ No newline at end of file diff --git a/samples/TestJavascript/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id b/samples/TestJavascript/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id new file mode 100644 index 0000000000..56b3df641c --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/res/explosion.png.REMOVED.git-id @@ -0,0 +1 @@ +97bca7d49fb6ec5c330f6ab6f5f49d335601a669 \ No newline at end of file diff --git a/samples/TestJavascript/Resources/MoonWarriors/res/loading.png.REMOVED.git-id b/samples/TestJavascript/Resources/MoonWarriors/res/loading.png.REMOVED.git-id new file mode 100644 index 0000000000..a35d4e432f --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/res/loading.png.REMOVED.git-id @@ -0,0 +1 @@ +ca7905a1a07e2be3e02fbf329772c2c361400af7 \ No newline at end of file diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/AboutLayer.js b/samples/TestJavascript/Resources/MoonWarriors/src/AboutLayer.js new file mode 100644 index 0000000000..4d188d335a --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/AboutLayer.js @@ -0,0 +1,47 @@ +var AboutLayer = cc.Layer.extend({ + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint(cc.p(0,0)); + this.addChild(sp, 0, 1); + + var cacheImage = cc.TextureCache.getInstance().addImage(s_menuTitle); + var title = cc.Sprite.createWithTexture(cacheImage, cc.rect(0, 36, 100, 34)); + title.setPosition(cc.p(winSize.width / 2, winSize.height - 60)); + this.addChild(title); + + // There is a bug in LabelTTF native. Apparently it fails with some unicode chars. +// var about = cc.LabelTTF.create(" This showcase utilizes many features from Cocos2d-html5 engine, including: Parallax background, tilemap, actions, ease, frame animation, schedule, Labels, keyboard Dispatcher, Scene Transition. \n Art and audio is copyrighted by Enigmata Genus Revenge, you may not use any copyrigted material without permission. This showcase is licensed under GPL. \n \n Programmer: \n Shengxiang Chen (陈升想) \n Dingping Lv (吕定平) \n Effects animation: Hao Wu(吴昊)\n Quality Assurance: Sean Lin(林顺)", "Arial", 14, cc.size(winSize.width * 0.85, 100), cc.TEXT_ALIGNMENT_LEFT ); + var about = cc.LabelTTF.create(" This showcase utilizes many features from Cocos2d-html5 engine, including: Parallax background, tilemap, actions, ease, frame animation, schedule, Labels, keyboard Dispatcher, Scene Transition. \n Art and audio is copyrighted by Enigmata Genus Revenge, you may not use any copyrigted material without permission. This showcase is licensed under GPL. \n\nProgrammer: \n Shengxiang Chen\n Dingping Lv \n Effects animation: Hao Wu\n Quality Assurance: Sean Lin", "Arial", 14, cc.size(winSize.width * 0.85, 320), cc.TEXT_ALIGNMENT_LEFT ); + about.setPosition(cc.p(winSize.width / 2, winSize.height/2 -20) ); + about.setAnchorPoint( cc.p(0.5, 0.5)); + this.addChild(about); + + var label = cc.LabelTTF.create("Go back", "Arial", 14); + var back = cc.MenuItemLabel.create(label, this, this.backCallback); + var menu = cc.Menu.create(back); + menu.setPosition(cc.p(winSize.width / 2, 40)); + this.addChild(menu); + bRet = true; + } + + return bRet; + }, + backCallback:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(SysMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + } +}); + +AboutLayer.create = function () { + var sg = new AboutLayer(); + if (sg && sg.init()) { + return sg; + } + return null; +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/Bullet.js b/samples/TestJavascript/Resources/MoonWarriors/src/Bullet.js new file mode 100644 index 0000000000..d22c3b015a --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/Bullet.js @@ -0,0 +1,62 @@ +//bullet +var Bullet = cc.Sprite.extend({ + active:true, + xVelocity:0, + yVelocity:200, + power:1, + HP:1, + moveType:null, + zOrder:3000, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + parentType:MW.BULLET_TYPE.PLAYER, + ctor:function (bulletSpeed, weaponType, attackMode) { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + this.yVelocity = -bulletSpeed; + this.attackMode = attackMode; + cc.SpriteFrameCache.getInstance().addSpriteFrames(s_bullet_plist); + this.initWithSpriteFrameName(weaponType); + this.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + /*var tmpAction; + switch (this.attackMode) { + case MW.ENEMY_MOVE_TYPE.NORMAL: + tmpAction = cc.MoveBy.create(2, cc.p(this.getPosition().x, 400)); + break; + case MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN: + tmpAction = cc.MoveTo.create(2, GameLayer.create()._ship.getPosition()); + break; + } + this.runAction(tmpAction);*/ + }, + update:function (dt) { + var p = this.getPosition(); + p.x -= this.xVelocity * dt; + p.y -= this.yVelocity * dt; + this.setPosition( p ); + if (this.HP <= 0) { + this.active = false; + } + }, + destroy:function () { + var explode = cc.Sprite.create(s_hit); + explode.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + explode.setPosition(this.getPosition()); + explode.setRotation(Math.random()*360); + explode.setScale(0.75); + this.getParent().addChild(explode,9999); + cc.ArrayRemoveObject(MW.CONTAINER.ENEMY_BULLETS,this); + cc.ArrayRemoveObject(MW.CONTAINER.PLAYER_BULLETS,this); + this.removeFromParentAndCleanup(true); + var removeExplode = cc.CallFunc.create(explode,explode.removeFromParentAndCleanup); + explode.runAction(cc.ScaleBy.create(0.3, 2,2)); + explode.runAction(cc.Sequence.create(cc.FadeOut.create(0.3), removeExplode)); + }, + hurt:function () { + this.HP--; + }, + collideRect:function(){ + var p = this.getPosition(); + return cc.rect(p.x - 3, p.y - 3, 6, 6); + } +}); diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/Effect.js b/samples/TestJavascript/Resources/MoonWarriors/src/Effect.js new file mode 100644 index 0000000000..faaa03c491 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/Effect.js @@ -0,0 +1,78 @@ +var flareEffect = function (parent, target, callback) { + var flare = cc.Sprite.create(s_flare); + flare.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + parent.addChild(flare, 10); + flare.setOpacity(0); + flare.setPosition(cc.p(-30, 297)); + flare.setRotation(-120); + flare.setScale(0.2); + + var opacityAnim = cc.FadeTo.create(0.5, 255); + var opacDim = cc.FadeTo.create(1, 0); + var biggeAnim = cc.ScaleBy.create(0.7, 1.2, 1.2); + var biggerEase = cc.EaseSineOut.create(biggeAnim); + var moveAnim = cc.MoveBy.create(0.5, cc.p(328, 0)); + var easeMove = cc.EaseSineOut.create(moveAnim); + var rotateAnim = cc.RotateBy.create(2.5, 90); + var rotateEase = cc.EaseExponentialOut.create(rotateAnim); + var bigger = cc.ScaleTo.create(0.5, 1); + + var onComplete = cc.CallFunc.create(target, callback); + var killflare = cc.CallFunc.create(flare, function () { + this.getParent().removeChild(this,true); + }); + flare.runAction(cc.Sequence.create(opacityAnim, biggerEase, opacDim, killflare, onComplete)); + flare.runAction(easeMove); + flare.runAction(rotateEase); + flare.runAction(bigger); +}; + +var removeFromParent = function( sprite ) +{ + sprite.removeFromParentAndCleanup( true ); +}; + +var spark = function (ccpoint, parent, scale, duration) { + scale = scale || 0.3; + duration = duration || 0.5; + + var one = cc.Sprite.create(s_explode1); + var two = cc.Sprite.create(s_explode2); + var three = cc.Sprite.create(s_explode3); + + one.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + two.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + three.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + + one.setPosition(ccpoint); + two.setPosition(ccpoint); + three.setPosition(ccpoint); + + //parent.addChild(one); + parent.addChild(two); + parent.addChild(three); + one.setScale(scale); + two.setScale(scale); + three.setScale(scale); + + three.setRotation(Math.random() * 360); + + var left = cc.RotateBy.create(duration, -45); + var right = cc.RotateBy.create(duration, 45); + var scaleBy = cc.ScaleBy.create(duration, 3, 3); + var fadeOut = cc.FadeOut.create(duration); + var remove = cc.CallFunc.create(this, removeFromParent ); + var seq = cc.Sequence.create( fadeOut, remove ); + + one.runAction(left); + two.runAction(right); + + one.runAction(scaleBy); + two.runAction(scaleBy.copy()); + three.runAction(scaleBy.copy()); + + one.runAction(seq); + two.runAction(seq.copy() ); + three.runAction(seq.copy()); +}; + diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/Enemy.js b/samples/TestJavascript/Resources/MoonWarriors/src/Enemy.js new file mode 100644 index 0000000000..e266118547 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/Enemy.js @@ -0,0 +1,75 @@ +var Enemy = cc.Sprite.extend({ + eID:0, + active:true, + speed:200, + bulletSpeed:-200, + HP:15, + bulletPowerValue:1, + moveType:null, + scoreValue:200, + zOrder:1000, + delayTime:1 + 1.2 * Math.random(), + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + _hurtColorLife:0, + ctor:function (arg) { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + this.HP = arg.HP; + this.moveType = arg.moveType; + this.scoreValue = arg.scoreValue; + this.attackMode = arg.attackMode; + + this.initWithSpriteFrameName(arg.textureName); + this.schedule(this.shoot, this.delayTime); + }, + _timeTick:0, + update:function (dt) { + if (this.HP <= 0) { + this.active = false; + } + this._timeTick += dt; + if (this._timeTick > 0.1) { + this._timeTick = 0; + if (this._hurtColorLife > 0) { + this._hurtColorLife--; + } + if (this._hurtColorLife == 1) { + this.setColor( cc.WHITE ); + } + } + }, + destroy:function () { + MW.SCORE += this.scoreValue; + var a = new Explosion(); + a.setPosition(this.getPosition()); + this.getParent().addChild(a); + spark(this.getPosition(),this.getParent(), 1.2, 0.7); + cc.ArrayRemoveObject(MW.CONTAINER.ENEMIES,this); + this.removeFromParentAndCleanup(true); + if(MW.SOUND){ + cc.AudioEngine.getInstance().playEffect(s_explodeEffect); + } + }, + shoot:function () { + var p = this.getPosition(); + var b = new Bullet(this.bulletSpeed, "W2.png", this.attackMode); + MW.CONTAINER.ENEMY_BULLETS.push(b); + this.getParent().addChild(b, b.zOrder, MW.UNIT_TAG.ENMEY_BULLET); + b.setPosition(cc.p(p.x, p.y - this.getContentSize().height * 0.2)); + }, + hurt:function () { + this._hurtColorLife = 2; + this.HP--; + this.setColor( cc.RED ); + }, + collideRect:function(){ + var a = this.getContentSize(); + var p = this.getPosition(); + return cc.rect(p.x - a.width/2, p.y - a.height/4,a.width,a.height/2); + } +}); + +Enemy.sharedEnemy = function(){ + cc.SpriteFrameCache.getInstance().addSpriteFrames(s_Enemy_plist, s_Enemy); +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/Explosion.js b/samples/TestJavascript/Resources/MoonWarriors/src/Explosion.js new file mode 100644 index 0000000000..8ccd225c5d --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/Explosion.js @@ -0,0 +1,38 @@ +var Explosion = cc.Sprite.extend({ + tmpWidth:0, + tmpHeight:0, + ctor:function () { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + var pFrame = cc.SpriteFrameCache.getInstance().getSpriteFrame("explosion_01.png"); + this.initWithSpriteFrame(pFrame); + + var cs = this.getContentSize(); + this.tmpWidth = cs.width; + this.tmpHeight = cs.height; + + var animation = cc.AnimationCache.getInstance().getAnimation("Explosion"); + this.runAction(cc.Sequence.create( + cc.Animate.create(animation), + cc.CallFunc.create(this, this.destroy) + )); + this.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + }, + destroy:function () { + this.getParent().removeChild(this,true); + } +}); + +Explosion.sharedExplosion = function () { + cc.SpriteFrameCache.getInstance().addSpriteFrames(s_explosion_plist); + var animFrames = []; + var str = ""; + for (var i = 1; i < 35; i++) { + str = "explosion_" + (i < 10 ? ("0" + i) : i) + ".png"; + var frame = cc.SpriteFrameCache.getInstance().getSpriteFrame(str); + animFrames.push(frame); + } + var animation = cc.Animation.create(animFrames, 0.04); + cc.AnimationCache.getInstance().addAnimation(animation, "Explosion"); +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/GameControlMenu.js b/samples/TestJavascript/Resources/MoonWarriors/src/GameControlMenu.js new file mode 100644 index 0000000000..3fcdac736e --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/GameControlMenu.js @@ -0,0 +1,35 @@ +var GameControlMenu = cc.Layer.extend({ + ctor:function() { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Layer); + }, + init:function () { + var bRet = false; + if (this._super()) { + cc.MenuItemFont.setFontSize(18); + cc.MenuItemFont.setFontName("Arial"); + var systemMenu = cc.MenuItemFont.create("Main Menu", this, this.sysMenu); + var menu = cc.Menu.create(systemMenu); + menu.setPosition(cc.p(0, 0)); + systemMenu.setAnchorPoint(cc.p(0, 0)); + systemMenu.setPosition(cc.p(winSize.width-95, 5)); + this.addChild(menu, 1, 2); + bRet = true; + } + + return bRet; + }, + sysMenu:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(SysMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2,scene)); + } +}); + +GameControlMenu.create = function () { + var sg = new GameControlMenu(); + if (sg && sg.init()) { + return sg; + } + return null; +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/GameController.js b/samples/TestJavascript/Resources/MoonWarriors/src/GameController.js new file mode 100644 index 0000000000..d5aed4be94 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/GameController.js @@ -0,0 +1,70 @@ +/** + * Cocos2d-html5 show case : Moon Warriors + * + * @Licensed: + * This showcase is licensed under GPL. + * + * @Authors: + * Programmer: Shengxiang Chen (陈升想), Dingping Lv (吕定平), Ricardo Quesada + * Effects animation: Hao Wu (吴昊) + * Quality Assurance: Sean Lin (林顺) + * + * @Links: + * http://www.cocos2d-x.org + * http://bbs.html5china.com + * + */ + + +MW.GameController = cc.Class.extend({ + _curScene:null, + _gameState:MW.GAME_STATE.HOME, + _isNewGame:true, + _curLevel:MW.LEVEL.STAGE1, + _selectLevel:MW.LEVEL.STAGE1, + init:function () { + return true; + }, + setCurScene:function (s) { + if (this._curScene != s) { + if (this._curScene !== null) { + this._curScene.onExit(); + } + this._curScene = s; + if (this._curScene) { + this._curScene.onEnter(); + cc.Director.getInstance().replaceScene(s); + } + } + }, + getCurScene:function () { + return this._curScene; + }, + runGame:function () { + + }, + newGame:function () { + + }, + option:function () { + + }, + about:function () { + + } +}); + +MW.GameController.getInstance = function () { + cc.Assert(this._sharedGame, "Havn't call setSharedGame"); + if (!this._sharedGame) { + this._sharedGame = new MW.GameController(); + if (this._sharedGame.init()) { + return this._sharedGame; + } + } else { + return this._sharedGame; + } + return null; +}; + +MW.GameController._sharedGame = null; \ No newline at end of file diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/GameLayer.js b/samples/TestJavascript/Resources/MoonWarriors/src/GameLayer.js new file mode 100644 index 0000000000..60ee0ba738 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/GameLayer.js @@ -0,0 +1,315 @@ +// +// MoonWarriors +// +// Handles the Game Logic +// + +STATE_PLAYING = 0; +STATE_GAMEOVER = 1; + +var GameLayer = cc.Layer.extend({ + _time:null, + _ship:null, + _backSky:null, + _backSkyHeight:0, + _backSkyRe:null, + _backTileMap:null, + _backTileMapHeight:0, + _backTileMapRe:null, + _levelManager:null, + _tmpScore:0, + _isBackSkyReload:false, + _isBackTileReload:false, + lbScore:null, + screenRect:null, + explosionAnimation:[], + _beginPos:cc.p(0, 0), + _state:STATE_PLAYING, + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + + // reset global values + MW.CONTAINER.ENEMIES = []; + MW.CONTAINER.ENEMY_BULLETS = []; + MW.CONTAINER.PLAYER_BULLETS = []; + MW.SCORE = 0; + MW.LIFE = 4; + this._state = STATE_PLAYING; + + Explosion.sharedExplosion(); + Enemy.sharedEnemy(); + winSize = cc.Director.getInstance().getWinSize(); + this._levelManager = new LevelManager(this); + this.initBackground(); + this.screenRect = cc.rect(0, 0, winSize.width, winSize.height + 10); + + // score + this.lbScore = cc.LabelBMFont.create("Score: 0", s_arial14_fnt); + this.lbScore.setAnchorPoint( cc.p(1,0) ); + this.lbScore.setAlignment( cc.TEXT_ALIGNMENT_RIGHT ); + this.addChild(this.lbScore, 1000); + this.lbScore.setPosition(cc.p(winSize.width - 5 , winSize.height - 30)); + + // ship life + var shipTexture = cc.TextureCache.getInstance().addImage(s_ship01); + var life = cc.Sprite.createWithTexture(shipTexture, cc.rect(0, 0, 60, 38)); + life.setScale(0.6); + life.setPosition(cc.p(30, 460)); + this.addChild(life, 1, 5); + + // ship Life count + this._lbLife = cc.LabelTTF.create("0", "Arial", 20); + this._lbLife.setPosition(cc.p(60, 463)); + this._lbLife.setColor(cc.RED); + this.addChild(this._lbLife, 1000); + + // ship + this._ship = new Ship(); + this.addChild(this._ship, this._ship.zOrder, MW.UNIT_TAG.PLAYER); + + // accept touch now! + + var t = cc.config.deviceType; + if( t == 'browser' ) { + this.setTouchEnabled(true); + this.setKeyboardEnabled(true); + } else if( t == 'desktop' ) { + this.setMouseEnabled(true); + } else if( t == 'mobile' ) { + this.setTouchEnabled(true); + } + + // schedule + this.scheduleUpdate(); + this.schedule(this.scoreCounter, 1); + + if (MW.SOUND) { + cc.AudioEngine.getInstance().playBackgroundMusic(s_bgMusic, true); + } + + bRet = true; + } + return bRet; + }, + scoreCounter:function () { + if( this._state == STATE_PLAYING ) { + this._time++; + + var minute = 0 | (this._time / 60); + var second = this._time % 60; + minute = minute > 9 ? minute : "0" + minute; + second = second > 9 ? second : "0" + second; + var curTime = minute + ":" + second; + this._levelManager.loadLevelResource(this._time); + } + }, + + onTouchesMoved:function (touches, event) { + this.processEvent( touches[0] ); + }, + + onMouseDragged:function( event ) { + this.processEvent( event ); + }, + + processEvent:function( event ) { + if( this._state == STATE_PLAYING ) { + var delta = event.getDelta(); + var curPos = this._ship.getPosition(); + curPos= cc.pAdd( curPos, delta ); + curPos = cc.pClamp(curPos, cc.POINT_ZERO, cc.p(winSize.width, winSize.height) ); + this._ship.setPosition( curPos ); + } + }, + + onKeyDown:function (e) { + MW.KEYS[e] = true; + }, + + onKeyUp:function (e) { + MW.KEYS[e] = false; + }, + + update:function (dt) { + if( this._state == STATE_PLAYING ) { + this.checkIsCollide(); + this.removeInactiveUnit(dt); + this.checkIsReborn(); + this.updateUI(); + } + + if( cc.config.deviceType == 'browser' ) + cc.$("#cou").innerHTML = "Ship:" + 1 + ", Enemy: " + MW.CONTAINER.ENEMIES.length + ", Bullet:" + MW.CONTAINER.ENEMY_BULLETS.length + "," + MW.CONTAINER.PLAYER_BULLETS.length + " all:" + this.getChildren().length; + }, + checkIsCollide:function () { + var selChild, bulletChild; + //check collide + var i =0; + for (i = 0; i < MW.CONTAINER.ENEMIES.length; i++) { + selChild = MW.CONTAINER.ENEMIES[i]; + for (var j = 0; j < MW.CONTAINER.PLAYER_BULLETS.length; j++) { + bulletChild = MW.CONTAINER.PLAYER_BULLETS[j]; + if (this.collide(selChild, bulletChild)) { + bulletChild.hurt(); + selChild.hurt(); + } + if (!cc.rectIntersectsRect(this.screenRect, bulletChild.getBoundingBox() )) { + bulletChild.destroy(); + } + } + if (this.collide(selChild, this._ship)) { + if (this._ship.active) { + selChild.hurt(); + this._ship.hurt(); + } + } + if (!cc.rectIntersectsRect(this.screenRect, selChild.getBoundingBox() )) { + selChild.destroy(); + } + } + + for (i = 0; i < MW.CONTAINER.ENEMY_BULLETS.length; i++) { + selChild = MW.CONTAINER.ENEMY_BULLETS[i]; + if (this.collide(selChild, this._ship)) { + if (this._ship.active) { + selChild.hurt(); + this._ship.hurt(); + } + } + if (!cc.rectIntersectsRect(this.screenRect, selChild.getBoundingBox() )) { + selChild.destroy(); + } + } + }, + removeInactiveUnit:function (dt) { + var selChild, layerChildren = this.getChildren(); + for (var i in layerChildren) { + selChild = layerChildren[i]; + if (selChild) { + if( typeof selChild.update == 'function' ) { + selChild.update(dt); + var tag = selChild.getTag(); + if ((tag == MW.UNIT_TAG.PLAYER) || (tag == MW.UNIT_TAG.PLAYER_BULLET) || + (tag == MW.UNIT_TAG.ENEMY) || (tag == MW.UNIT_TAG.ENMEY_BULLET)) { + if (selChild && !selChild.active) { + selChild.destroy(); + } + } + } + } + } + }, + checkIsReborn:function () { + if (MW.LIFE > 0 && !this._ship.active) { + // ship + this._ship = new Ship(); + this.addChild(this._ship, this._ship.zOrder, MW.UNIT_TAG.PLAYER); + } + else if (MW.LIFE <= 0 && !this._ship.active) { + this._state = STATE_GAMEOVER; + // XXX: needed for JS bindings. + this._ship = null; + this.runAction(cc.Sequence.create( + cc.DelayTime.create(0.2), + cc.CallFunc.create(this, this.onGameOver))); + } + }, + updateUI:function () { + if (this._tmpScore < MW.SCORE) { + this._tmpScore += 5; + } + this._lbLife.setString(MW.LIFE); + this.lbScore.setString("Score: " + this._tmpScore); + }, + collide:function (a, b) { + var aRect = a.collideRect(); + var bRect = b.collideRect(); + if (cc.rectIntersectsRect(aRect, bRect)) { + return true; + } + }, + initBackground:function () { + // bg + this._backSky = cc.Sprite.create(s_bg01); + this._backSky.setAnchorPoint(cc.p(0, 0)); + this._backSkyHeight = this._backSky.getContentSize().height; + this.addChild(this._backSky, -10); + + //tilemap + this._backTileMap = cc.TMXTiledMap.create(s_level01); + this.addChild(this._backTileMap, -9); + this._backTileMapHeight = this._backTileMap.getMapSize().height * this._backTileMap.getTileSize().height; + + this._backSkyHeight -= 48; + this._backTileMapHeight -= 200; + this._backSky.runAction(cc.MoveBy.create(3, cc.p(0, -48))); + this._backTileMap.runAction(cc.MoveBy.create(3, cc.p(0, -200))); + + this.schedule(this.movingBackground, 3); + }, + movingBackground:function () { + this._backSky.runAction(cc.MoveBy.create(3, cc.p(0, -48))); + this._backTileMap.runAction(cc.MoveBy.create(3, cc.p(0, -200))); + this._backSkyHeight -= 48; + this._backTileMapHeight -= 200; + + if (this._backSkyHeight <= winSize.height) { + if (!this._isBackSkyReload) { + this._backSkyRe = cc.Sprite.create(s_bg01); + this._backSkyRe.setAnchorPoint(cc.p(0, 0)); + this.addChild(this._backSkyRe, -10); + this._backSkyRe.setPosition(cc.p(0, winSize.height)); + this._isBackSkyReload = true; + } + this._backSkyRe.runAction(cc.MoveBy.create(3, cc.p(0, -48))); + } + if (this._backSkyHeight <= 0) { + this._backSkyHeight = this._backSky.getContentSize().height; + this.removeChild(this._backSky, true); + this._backSky = this._backSkyRe; + this._backSkyRe = null; + this._isBackSkyReload = false; + } + + if (this._backTileMapHeight <= winSize.height) { + if (!this._isBackTileReload) { + this._backTileMapRe = cc.TMXTiledMap.create(s_level01); + this.addChild(this._backTileMapRe, -9); + this._backTileMapRe.setPosition(cc.p(0, winSize.height)); + this._isBackTileReload = true; + } + this._backTileMapRe.runAction(cc.MoveBy.create(3, cc.p(0, -200))); + } + if (this._backTileMapHeight <= 0) { + this._backTileMapHeight = this._backTileMapRe.getMapSize().height * this._backTileMapRe.getTileSize().height; + this.removeChild(this._backTileMap, true); + this._backTileMap = this._backTileMapRe; + this._backTileMapRe = null; + this._isBackTileReload = false; + } + }, + onGameOver:function () { + var scene = cc.Scene.create(); + scene.addChild(GameOver.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + } +}); + +GameLayer.create = function () { + var sg = new GameLayer(); + if (sg && sg.init()) { + return sg; + } + return null; +}; + +GameLayer.scene = function () { + var scene = cc.Scene.create(); + var layer = GameLayer.create(); + scene.addChild(layer, 1); + return scene; +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/GameOver.js b/samples/TestJavascript/Resources/MoonWarriors/src/GameOver.js new file mode 100644 index 0000000000..7fcf87c645 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/GameOver.js @@ -0,0 +1,83 @@ +var GameOver = cc.Layer.extend({ + _ship:null, + _lbScore:0, + ctor:function() { + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Layer); + }, + init:function () { + var bRet = false; + if (this._super()) { + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint( cc.p(0,0) ); + this.addChild(sp, 0, 1); + + var logo = cc.Sprite.create(s_gameOver); + logo.setAnchorPoint(cc.p(0,0)); + logo.setPosition(cc.p(0,300)); + this.addChild(logo,10,1); + + var playAgainNormal = cc.Sprite.create(s_menu, cc.rect(378, 0, 126, 33)); + var playAgainSelected = cc.Sprite.create(s_menu, cc.rect(378, 33, 126, 33)); + var playAgainDisabled = cc.Sprite.create(s_menu, cc.rect(378, 33 * 2, 126, 33)); + + var cocos2dhtml5 = cc.Sprite.create(s_cocos2dhtml5); + cocos2dhtml5.setPosition(cc.p(160,150)); + this.addChild(cocos2dhtml5,10); + var playAgain = cc.MenuItemSprite.create(playAgainNormal, playAgainSelected, playAgainDisabled, this, function(){ + flareEffect(this,this,this.onPlayAgain); + }); + + var menu = cc.Menu.create(playAgain); + this.addChild(menu, 1, 2); + menu.setPosition(cc.p(winSize.width / 2, 220)); + + var lbScore = cc.LabelTTF.create("Your Score:"+MW.SCORE,"Arial Bold",16); + lbScore.setPosition(cc.p(160,280)); + lbScore.setColor(cc.c3b(250,179,0)); + this.addChild(lbScore,10); + + var b1 = cc.LabelTTF.create("Download Cocos2d-html5","Arial",14); + var b2 = cc.LabelTTF.create("Download This Sample","Arial",14); + var menu1 = cc.MenuItemLabel.create(b1,this,function(){ + window.location.href = "http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-html5"; + }); + var menu2 = cc.MenuItemLabel.create(b2,this,function(){ + window.location.href = "https://github.com/ShengxiangChen/MoonWarriors"; + }); + var cocos2dMenu = cc.Menu.create(menu1,menu2); + cocos2dMenu.alignItemsVerticallyWithPadding(10); + cocos2dMenu.setPosition(cc.p(160,80)); + this.addChild(cocos2dMenu); + + + if(MW.SOUND){ + cc.AudioEngine.getInstance().playBackgroundMusic(s_mainMainMusic); + } + + bRet = true; + } + return bRet; + }, + onPlayAgain:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(GameLayer.create()); + scene.addChild(GameControlMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2,scene)); + } +}); + +GameOver.create = function () { + var sg = new GameOver(); + if (sg && sg.init()) { + return sg; + } + return null; +}; + +GameOver.scene = function () { + var scene = cc.Scene.create(); + var layer = GameOver.create(); + scene.addChild(layer); + return scene; +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/LevelManager.js b/samples/TestJavascript/Resources/MoonWarriors/src/LevelManager.js new file mode 100644 index 0000000000..6866d7412f --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/LevelManager.js @@ -0,0 +1,99 @@ +var LevelManager = cc.Class.extend({ + _currentLevel:null, + _gameLayer:null, + ctor:function(gameLayer){ + if(!gameLayer){ + throw "gameLayer must be non-nil"; + } + this._currentLevel = Level1; + this._gameLayer = gameLayer; + this.setLevel(this._currentLevel); + }, + + setLevel:function(level){ + for(var i = 0; i< level.enemies.length; i++){ + this._currentLevel.enemies[i].ShowTime = this._minuteToSecond(this._currentLevel.enemies[i].ShowTime); + } + }, + _minuteToSecond:function(minuteStr){ + if(!minuteStr) + return 0; + if(typeof(minuteStr) != "number"){ + var mins = minuteStr.split(':'); + if(mins.length == 1){ + return parseInt(mins[0],10); + }else { + return parseInt(mins[0],10 )* 60 + parseInt(mins[1],10); + } + } + return minuteStr; + }, + + loadLevelResource:function(deltaTime){ + //load enemy + for(var i = 0; i< this._currentLevel.enemies.length; i++){ + var selEnemy = this._currentLevel.enemies[i]; + if(selEnemy){ + if(selEnemy.ShowType == "Once"){ + if(selEnemy.ShowTime == deltaTime){ + for(var tIndex = 0; tIndex < selEnemy.Types.length;tIndex++ ){ + this.addEnemyToGameLayer(selEnemy.Types[tIndex]); + } + } + }else if(selEnemy.ShowType == "Repeate"){ + if(deltaTime % selEnemy.ShowTime === 0){ + for(var rIndex = 0; rIndex < selEnemy.Types.length;rIndex++ ){ + this.addEnemyToGameLayer(selEnemy.Types[rIndex]); + } + } + } + } + } + }, + + addEnemyToGameLayer:function(enemyType){ + var addEnemy = new Enemy(EnemyType[enemyType]); + + var enemypos = cc.p( 80 + (winSize.width - 160) * Math.random(), winSize.height); + var enemycs = addEnemy.getContentSize(); + addEnemy.setPosition( enemypos ); + + + var offset, tmpAction; + var a0=0; + var a1=0; + switch (addEnemy.moveType) { + case MW.ENEMY_MOVE_TYPE.ATTACK: + offset = this._gameLayer._ship.getPosition(); + tmpAction = cc.MoveTo.create(1, offset); + break; + case MW.ENEMY_MOVE_TYPE.VERTICAL: + offset = cc.p(0, -winSize.height - enemycs.height); + tmpAction = cc.MoveBy.create(4, offset); + break; + case MW.ENEMY_MOVE_TYPE.HORIZONTAL: + offset = cc.p(0, -100 - 200 * Math.random()); + a0 = cc.MoveBy.create(0.5, offset); + a1 = cc.MoveBy.create(1, cc.p(-50 - 100 * Math.random(), 0)); + var onComplete = cc.CallFunc.create(addEnemy, function (pSender) { + var a2 = cc.DelayTime.create(1); + var a3 = cc.MoveBy.create(1, cc.p(100 + 100 * Math.random(), 0)); + pSender.runAction(cc.RepeatForever.create( + cc.Sequence.create(a2, a3, a2.copy(), a3.reverse()) + )); + }); + tmpAction = cc.Sequence.create(a0, a1, onComplete); + break; + case MW.ENEMY_MOVE_TYPE.OVERLAP: + var newX = (enemypos.x <= winSize.width / 2) ? 320 : -320; + a0 = cc.MoveBy.create(4, cc.p(newX, -240)); + a1 = cc.MoveBy.create(4,cc.p(-newX,-320)); + tmpAction = cc.Sequence.create(a0,a1); + break; + } + + this._gameLayer.addChild(addEnemy, addEnemy.zOrder, MW.UNIT_TAG.ENEMY); + MW.CONTAINER.ENEMIES.push(addEnemy); + addEnemy.runAction(tmpAction); + } +}); diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/Resource.js b/samples/TestJavascript/Resources/MoonWarriors/src/Resource.js new file mode 100644 index 0000000000..c2f6becdad --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/Resource.js @@ -0,0 +1,89 @@ +var dirImg = ""; +var dirMusic = ""; +var musicSuffix = ".mp3"; +if( cc.config.deviceType == 'browser' || cc.config.engine == 'cocos2d-x') { + dirImg = "MoonWarriors/res/"; + dirMusic = "MoonWarriors/res/Music/"; + musicSuffix = ""; +} + +//image +var s_bg01 = dirImg + "bg01.jpg"; +var s_loading = dirImg + "loading.png"; +var s_ship01 = dirImg + "ship01.png"; +var s_menu = dirImg + "menu.png"; +var s_logo = dirImg + "logo.png"; +var s_cocos2dhtml5 = dirImg + "cocos2d-html5.png"; +var s_gameOver = dirImg + "gameOver.png"; +var s_menuTitle = dirImg + "menuTitle.png"; +var s_Enemy = dirImg + "Enemy.png"; +var s_flare = dirImg + "flare.jpg"; +var s_bullet = dirImg + "bullet.png"; +var s_explosion = dirImg + "explosion.png"; +var s_explode1 = dirImg + "explode1.jpg"; +var s_explode2= dirImg + "explode2.jpg"; +var s_explode3 = dirImg + "explode3.jpg"; +var s_hit = dirImg + "hit.jpg"; +var s_arial14 = dirImg + "arial-14.png"; +var s_arial14_fnt = dirImg + "arial-14.fnt"; + +//music +var s_bgMusic = dirMusic + "bgMusic" + musicSuffix; +var s_mainMainMusic = dirMusic + "mainMainMusic" + musicSuffix; + +//effect +var s_buttonEffect = dirMusic + "buttonEffet" + musicSuffix; +var s_explodeEffect = dirMusic + "explodeEffect" + musicSuffix; +var s_fireEffect = dirMusic + "fireEffect" + musicSuffix; +var s_shipDestroyEffect = dirMusic + "shipDestroyEffect" + musicSuffix; + +//tmx +var s_level01 = dirImg + "level01.tmx"; + +//plist +var s_Enemy_plist = dirImg + "Enemy.plist"; +var s_explosion_plist = dirImg + "explosion.plist"; +var s_bullet_plist = dirImg + "bullet.plist"; + +var g_ressources = [ + //image + {type:"image", src:s_bg01}, + {type:"image", src:s_loading}, + {type:"image", src:s_ship01}, + {type:"image", src:s_menu}, + {type:"image", src:s_logo}, + {type:"image", src:s_cocos2dhtml5}, + {type:"image", src:s_gameOver}, + {type:"image", src:s_menuTitle}, + {type:"image", src:s_Enemy}, + {type:"image", src:s_flare}, + {type:"image", src:s_bullet}, + {type:"image", src:s_explosion}, + {type:"image", src:s_explode1}, + {type:"image", src:s_explode2}, + {type:"image", src:s_explode3}, + {type:"image", src:s_hit}, + {type:"image", src:s_arial14}, + + //tmx + {type:"tmx", src:s_level01}, + + //plist + {type:"plist", src:s_Enemy_plist}, + {type:"plist", src:s_explosion_plist}, + {type:"plist", src:s_bullet_plist}, + + //music + {type:"bgm", src:s_bgMusic}, + {type:"bgm", src:s_mainMainMusic}, + + //effect + {type:"effect", src:s_buttonEffect}, + {type:"effect", src:s_explodeEffect}, + {type:"effect", src:s_fireEffect}, + {type:"effect", src:s_shipDestroyEffect}, + + // FNT + {type:"fnt", src:s_arial14_fnt} + +]; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/SettingsLayer.js b/samples/TestJavascript/Resources/MoonWarriors/src/SettingsLayer.js new file mode 100644 index 0000000000..4f8b545311 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/SettingsLayer.js @@ -0,0 +1,85 @@ +var SettingsLayer = cc.Layer.extend({ + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint(cc.p(0,0)); + this.addChild(sp, 0, 1); + + var cacheImage = cc.TextureCache.getInstance().addImage(s_menuTitle); + var title = cc.Sprite.createWithTexture(cacheImage, cc.rect(0, 0, 134, 34)); + title.setPosition(cc.p(winSize.width / 2, winSize.height - 120)); + this.addChild(title); + + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(18); + var title1 = cc.MenuItemFont.create("Sound"); + title1.setEnabled(false); + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(26); + var item1 = cc.MenuItemToggle.create( + cc.MenuItemFont.create("On"), + cc.MenuItemFont.create("Off") ); + item1.setCallback(this, this.soundControl ); + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(18); + var title2 = cc.MenuItemFont.create("Mode"); + title2.setEnabled(false); + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(26); + var item2 = cc.MenuItemToggle.create( + cc.MenuItemFont.create("Easy"), + cc.MenuItemFont.create("Normal"), + cc.MenuItemFont.create("Hard")); + item2.setCallback( this, this.modeControl ); + + + cc.MenuItemFont.setFontName("Arial"); + cc.MenuItemFont.setFontSize(26); + var label = cc.LabelTTF.create("Go back", "Arial", 20); + var back = cc.MenuItemLabel.create(label, this, this.backCallback); + back.setScale(0.8); + + var menu = cc.Menu.create(title1, title2, item1, item2, back); + menu.alignItemsInColumns(2, 2, 1); + this.addChild(menu); + + var cp_back = back.getPosition(); + cp_back.y -= 50.0; + back.setPosition(cp_back); + + + bRet = true; + } + + return bRet; + }, + backCallback:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(SysMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + soundControl:function(){ + MW.SOUND = MW.SOUND ? false : true; + if(!MW.SOUND){ + cc.AudioEngine.getInstance().stopBackgroundMusic(); + } + }, + modeControl:function(){ + } +}); + +SettingsLayer.create = function () { + var sg = new SettingsLayer(); + if (sg && sg.init()) { + return sg; + } + return null; +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/Ship.js b/samples/TestJavascript/Resources/MoonWarriors/src/Ship.js new file mode 100644 index 0000000000..84aa6342db --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/Ship.js @@ -0,0 +1,128 @@ +var Ship = cc.Sprite.extend({ + speed:220, + bulletSpeed:900, + HP:5, + bulletTypeValue:1, + bulletPowerValue:1, + throwBombing:false, + canBeAttack:true, + isThrowingBomb:false, + zOrder:3000, + maxBulletPowerValue:4, + appearPosition:cc.p(160, 60), + _hurtColorLife:0, + active:true, + ctor:function () { + + // needed for JS-Bindings compatibility + cc.associateWithNative( this, cc.Sprite ); + + //init life + var shipTexture = cc.TextureCache.getInstance().addImage(s_ship01); + this.initWithTexture(shipTexture, cc.rect(0, 0, 60, 38)); + this.setTag(this.zOrder); + this.setPosition(this.appearPosition); + + // set frame + var frame0 = cc.SpriteFrame.createWithTexture(shipTexture, cc.rect(0, 0, 60, 38)); + var frame1 = cc.SpriteFrame.createWithTexture(shipTexture, cc.rect(60, 0, 60, 38)); + + var animFrames = []; + animFrames.push(frame0); + animFrames.push(frame1); + + // ship animate + var animation = cc.Animation.create(animFrames, 0.1); + var animate = cc.Animate.create(animation); + this.runAction(cc.RepeatForever.create(animate)); + this.schedule(this.shoot, 1 / 6); + + //revive effect + this.canBeAttack = false; + var ghostSprite = cc.Sprite.createWithTexture(shipTexture, cc.rect(0, 45, 60, 38)); + ghostSprite.setBlendFunc(gl.SRC_ALPHA, gl.ONE); + ghostSprite.setScale(8); + ghostSprite.setPosition(cc.p(this.getContentSize().width / 2, 12)); + this.addChild(ghostSprite, 3000, 99999); + ghostSprite.runAction(cc.ScaleTo.create(0.5, 1, 1)); + var blinks = cc.Blink.create(3, 9); + var makeBeAttack = cc.CallFunc.create(this, function (t) { + t.canBeAttack = true; + t.setVisible(true); + t.removeChild(ghostSprite,true); + }); + this.runAction(cc.Sequence.create(cc.DelayTime.create(0.5), blinks, makeBeAttack)); + }, + update:function (dt) { + + // Keys are only enabled on the browser + if( cc.config.deviceType == 'browser' ) { + var pos = this.getPosition(); + if ((MW.KEYS[cc.KEY.w] || MW.KEYS[cc.KEY.up]) && pos.y <= winSize.height) { + pos.y += dt * this.speed; + } + if ((MW.KEYS[cc.KEY.s] || MW.KEYS[cc.KEY.down]) && pos.y >= 0) { + pos.y -= dt * this.speed; + } + if ((MW.KEYS[cc.KEY.a] || MW.KEYS[cc.KEY.left]) && pos.x >= 0) { + pos.x -= dt * this.speed; + } + if ((MW.KEYS[cc.KEY.d] || MW.KEYS[cc.KEY.right]) && pos.x <= winSize.width) { + pos.x += dt * this.speed; + } + this.setPosition( pos ); + } + + if (this.HP <= 0) { + this.active = false; + } + this._timeTick += dt; + if (this._timeTick > 0.1) { + this._timeTick = 0; + if (this._hurtColorLife > 0) { + this._hurtColorLife--; + } + if (this._hurtColorLife == 1) { + this.setColor(cc.WHITE); + } + } + }, + shoot:function (dt) { + //this.shootEffect(); + var offset = 13; + var p = this.getPosition(); + var cs = this.getContentSize(); + var a = new Bullet(this.bulletSpeed, "W1.png", MW.ENEMY_MOVE_TYPE.NORMAL); + MW.CONTAINER.PLAYER_BULLETS.push(a); + this.getParent().addChild(a, a.zOrder, MW.UNIT_TAG.PLAYER_BULLET); + a.setPosition(cc.p(p.x + offset, p.y + 3 + cs.height * 0.3)); + + var b = new Bullet(this.bulletSpeed, "W1.png", MW.ENEMY_MOVE_TYPE.NORMAL); + MW.CONTAINER.PLAYER_BULLETS.push(b); + this.getParent().addChild(b, b.zOrder, MW.UNIT_TAG.PLAYER_BULLET); + b.setPosition(cc.p(p.x - offset, p.y + 3 + cs.height * 0.3)); + }, + destroy:function () { + MW.LIFE--; + var p = this.getPosition(); + var myParent = this.getParent(); + myParent.addChild( new Explosion(p) ); + myParent.removeChild(this,true); + if (MW.SOUND) { + cc.AudioEngine.getInstance().playEffect(s_shipDestroyEffect); + } + }, + hurt:function () { + if (this.canBeAttack) { + this._hurtColorLife = 2; + this.HP--; + this.setColor(cc.RED); + } + }, + collideRect:function(){ + var p = this.getPosition(); + var a = this.getContentSize(); + var r = new cc.rect(p.x - a.width/2, p.y - a.height/2, a.width, a.height/2); + return r; + } +}); diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/SysMenu.js b/samples/TestJavascript/Resources/MoonWarriors/src/SysMenu.js new file mode 100644 index 0000000000..a265636363 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/SysMenu.js @@ -0,0 +1,110 @@ +cc.dumpConfig(); + +var SysMenu = cc.Layer.extend({ + _ship:null, + + ctor:function () { + cc.associateWithNative( this, cc.Layer ); + }, + init:function () { + var bRet = false; + if (this._super()) { + winSize = cc.Director.getInstance().getWinSize(); + var sp = cc.Sprite.create(s_loading); + sp.setAnchorPoint(cc.p(0,0)); + this.addChild(sp, 0, 1); + + var logo = cc.Sprite.create(s_logo); + logo.setAnchorPoint(cc.p(0, 0)); + logo.setPosition(cc.p(0, 250)); + this.addChild(logo, 10, 1); + + var newGameNormal = cc.Sprite.create(s_menu, cc.rect(0, 0, 126, 33)); + var newGameSelected = cc.Sprite.create(s_menu, cc.rect(0, 33, 126, 33)); + var newGameDisabled = cc.Sprite.create(s_menu, cc.rect(0, 33 * 2, 126, 33)); + + var gameSettingsNormal = cc.Sprite.create(s_menu, cc.rect(126, 0, 126, 33)); + var gameSettingsSelected = cc.Sprite.create(s_menu, cc.rect(126, 33, 126, 33)); + var gameSettingsDisabled = cc.Sprite.create(s_menu, cc.rect(126, 33 * 2, 126, 33)); + + var aboutNormal = cc.Sprite.create(s_menu, cc.rect(252, 0, 126, 33)); + var aboutSelected = cc.Sprite.create(s_menu, cc.rect(252, 33, 126, 33)); + var aboutDisabled = cc.Sprite.create(s_menu, cc.rect(252, 33 * 2, 126, 33)); + + var newGame = cc.MenuItemSprite.create(newGameNormal, newGameSelected, newGameDisabled, this, function () { + this.onButtonEffect(); + flareEffect(this, this, this.onNewGame); + }); + var gameSettings = cc.MenuItemSprite.create(gameSettingsNormal, gameSettingsSelected, gameSettingsDisabled, this, this.onSettings); + var about = cc.MenuItemSprite.create(aboutNormal, aboutSelected, aboutDisabled, this, this.onAbout); + + var menu = cc.Menu.create(newGame, gameSettings, about); + menu.alignItemsVerticallyWithPadding(10); + this.addChild(menu, 1, 2); + menu.setPosition(cc.p(winSize.width / 2, winSize.height / 2 - 80)); + this.schedule(this.update, 0.1); + + var tmp = cc.TextureCache.getInstance().addImage(s_ship01); + this._ship = cc.Sprite.createWithTexture(tmp,cc.rect(0, 45, 60, 38)); + this.addChild(this._ship, 0, 4); + var pos = cc.p(Math.random() * winSize.width, 0); + this._ship.setPosition( pos ); + this._ship.runAction(cc.MoveBy.create(2, cc.p(Math.random() * winSize.width, pos.y + winSize.height + 100))); + + if (MW.SOUND) { + cc.AudioEngine.getInstance().setBackgroundMusicVolume(0.7); + cc.AudioEngine.getInstance().playBackgroundMusic(s_mainMainMusic, true); + } + + bRet = true; + } + return bRet; + }, + onNewGame:function (pSender) { + var scene = cc.Scene.create(); + scene.addChild(GameLayer.create()); + scene.addChild(GameControlMenu.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + onSettings:function (pSender) { + this.onButtonEffect(); + var scene = cc.Scene.create(); + scene.addChild(SettingsLayer.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + onAbout:function (pSender) { + this.onButtonEffect(); + var scene = cc.Scene.create(); + scene.addChild(AboutLayer.create()); + cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); + }, + update:function () { + if (this._ship.getPosition().y > 480) { + var pos = cc.p(Math.random() * winSize.width, 10); + this._ship.setPosition( pos ); + this._ship.runAction( cc.MoveBy.create( + parseInt(5 * Math.random(), 10), + cc.p(Math.random() * winSize.width, pos.y + 480))); + } + }, + onButtonEffect:function(){ + if (MW.SOUND) { + var s = cc.AudioEngine.getInstance().playEffect(s_buttonEffect); + } + } +}); + +SysMenu.create = function () { + var sg = new SysMenu(); + if (sg && sg.init()) { + return sg; + } + return null; +}; + +SysMenu.scene = function () { + var scene = cc.Scene.create(); + var layer = SysMenu.create(); + scene.addChild(layer); + return scene; +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/config/EnemyType.js b/samples/TestJavascript/Resources/MoonWarriors/src/config/EnemyType.js new file mode 100644 index 0000000000..c947d58903 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/config/EnemyType.js @@ -0,0 +1,56 @@ +var EnemyType = [ + { + type:0, + textureName:"E0.png", + bulletType:"W2.png", + HP:1, + moveType:MW.ENEMY_MOVE_TYPE.ATTACK, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:15 + }, + { + type:1, + textureName:"E1.png", + bulletType:"W2.png", + HP:2, + moveType:MW.ENEMY_MOVE_TYPE.ATTACK, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:40 + }, + { + type:2, + textureName:"E2.png", + bulletType:"W2.png", + HP:4, + moveType:MW.ENEMY_MOVE_TYPE.HORIZONTAL, + attackMode:MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN, + scoreValue:60 + }, + { + type:3, + textureName:"E3.png", + bulletType:"W2.png", + HP:6, + moveType:MW.ENEMY_MOVE_TYPE.OVERLAP, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:80 + }, + { + type:4, + textureName:"E4.png", + bulletType:"W2.png", + HP:10, + moveType:MW.ENEMY_MOVE_TYPE.HORIZONTAL, + attackMode:MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN, + scoreValue:150 + }, + { + type:5, + textureName:"E5.png", + bulletType:"W2.png", + HP:15, + moveType:MW.ENEMY_MOVE_TYPE.HORIZONTAL, + attackMode:MW.ENEMY_MOVE_TYPE.NORMAL, + scoreValue:200 + } +]; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/config/GameConfig.js b/samples/TestJavascript/Resources/MoonWarriors/src/config/GameConfig.js new file mode 100644 index 0000000000..554d322aa1 --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/config/GameConfig.js @@ -0,0 +1,94 @@ +/** + * Cocos2d-html5 show case : Moon Warriors + * + * @Licensed: + * This showcase is licensed under GPL. + * + * @Authors: + * Programmer: Shengxiang Chen (陈升想), Dingping Lv (吕定平), Ricardo Quesada + * Effects animation: Hao Wu (吴昊) + * Quality Assurance: Sean Lin (林顺) + * + * @Links: + * http://www.cocos2d-x.org + * http://bbs.html5china.com + * + */ + +//game state +MW.GAME_STATE = { + HOME:0, + PLAY:1, + OVER:2 +}; + +//keys +MW.KEYS = []; + +//level +MW.LEVEL = { + STAGE1:1, + STAGE2:2, + STAGE3:3 +}; + +//life +MW.LIFE = 4; + +//score +MW.SCORE = 0; + +//sound +MW.SOUND = true; + +//enemy move type +MW.ENEMY_MOVE_TYPE = { + ATTACK:0, + VERTICAL:1, + HORIZONTAL:2, + OVERLAP:3 +}; + +//delta x +MW.DELTA_X = -100; + +//offset x +MW.OFFSET_X = -24; + +//rot +MW.ROT = -5.625; + +//bullet type +MW.BULLET_TYPE = { + PLAYER:1, + ENEMY:2 +}; + +//weapon type +MW.WEAPON_TYPE = { + ONE:1 +}; + +//unit tag +MW.UNIT_TAG = { + ENMEY_BULLET:900, + PLAYER_BULLET:901, + ENEMY:1000, + PLAYER:1000 +}; + +//attack mode +MW.ENEMY_ATTACK_MODE = { + NORMAL:1, + TSUIHIKIDAN:2 +}; + +//life up sorce +MW.LIFEUP_SORCE = [50000, 100000, 150000, 200000, 250000, 300000]; + +//container +MW.CONTAINER = { + ENEMIES:[], + ENEMY_BULLETS:[], + PLAYER_BULLETS:[] +}; diff --git a/samples/TestJavascript/Resources/MoonWarriors/src/config/Level.js b/samples/TestJavascript/Resources/MoonWarriors/src/config/Level.js new file mode 100644 index 0000000000..321a7a270f --- /dev/null +++ b/samples/TestJavascript/Resources/MoonWarriors/src/config/Level.js @@ -0,0 +1,49 @@ +var Level1 = { + enemies:[ + { + ShowType:"Repeate", + ShowTime:"00:02", + Types:[0,1,2] + }, + { + ShowType:"Repeate", + ShowTime:"00:05", + Types:[3,4,5] + } + /*{ + ShowType:"Repeate", + ShowTime:"00:08", + Types:[0,4,3,5] + }, + { + ShowType:"Once", + ShowTime:"00:6", + Types:[0,2,4,3] + }, + { + ShowType:"Once", + ShowTime:"00:16", + Types:[0,2,5,4,3] + }, + { + ShowType:"Once", + ShowTime:"00:25", + Types:[0,3,5,4,3] + }, + { + ShowType:"Once", + ShowTime:"00:35", + Types:[4,5,3,1,3] + }, + { + ShowType:"Once", + ShowTime:"00:50", + Types:[0,3,2,1,0,3] + }, + { + ShowType:"Once", + ShowTime:"01:15", + Types:[4,5,2,1,0] + }*/ + ] +}; diff --git a/samples/TestJavascript/Resources/js/jsb_constants.js b/samples/TestJavascript/Resources/js/jsb_constants.js new file mode 100644 index 0000000000..ac634f2712 --- /dev/null +++ b/samples/TestJavascript/Resources/js/jsb_constants.js @@ -0,0 +1,475 @@ +require('js/jsb_constants_gl.js'); +// cocos2d Helper + +cc.c3 = cc.c3 || function (r, g, b) { + return {r: r, g: g, b: b}; +}; + +cc.c3b = cc.c3; + +cc.c4 = cc.c4 || function (r, g, b, o) { + return {r: r, g: g, b: b, a: o}; +}; + +cc.c4b = cc.c4; + +cc.c4f = cc.c4f || function (r, g, b, o) { + return {r: r, g: g, b: b, a: o}; +}; + +cc.p = cc.p || function( x, y ) +{ + return {x:x, y:y}; +}; + +cc.g = cc.g || cc.p; +cc.log = cc.log || log; + +// +// cocos2d constants +// +cc.TEXTURE_PIXELFORMAT_RGBA8888 = 0; +cc.TEXTURE_PIXELFORMAT_RGB888 = 1; +cc.TEXTURE_PIXELFORMAT_RGB565 = 2; +cc.TEXTURE_PIXELFORMAT_A8 = 3; +cc.TEXTURE_PIXELFORMAT_I8 = 4; +cc.TEXTURE_PIXELFORMAT_AI88 = 5; +cc.TEXTURE_PIXELFORMAT_RGBA4444 = 6; +cc.TEXTURE_PIXELFORMAT_RGB5A1 = 7; +cc.TEXTURE_PIXELFORMAT_PVRTC4 = 8; +cc.TEXTURE_PIXELFORMAT_PVRTC4 = 9; +cc.TEXTURE_PIXELFORMAT_DEFAULT = cc.TEXTURE_PIXELFORMAT_RGBA8888; + +cc.TEXT_ALIGNMENT_LEFT = 0; +cc.TEXT_ALIGNMENT_CENTER = 1; +cc.TEXT_ALIGNMENT_RIGHT = 2; + +cc.VERTICAL_TEXT_ALIGNMENT_TOP = 0; +cc.VERTICAL_TEXT_ALIGNMENT_CENTER = 1; +cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM = 2; + +cc.IMAGE_FORMAT_JPEG = 0; +cc.IMAGE_FORMAT_PNG = 0; + +cc.PROGRESS_TIMER_TYPE_RADIAL = 0; +cc.PROGRESS_TIMER_TYPE_BAR = 1; + +cc.PARTICLE_TYPE_FREE = 0; +cc.PARTICLE_TYPE_RELATIVE = 1; +cc.PARTICLE_TYPE_GROUPED = 2; +cc.PARTICLE_DURATION_INFINITY = -1; +cc.PARTICLE_MODE_GRAVITY = 0; +cc.PARTICLE_MODE_RADIUS = 1; +cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE = -1; +cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS = -1; + +cc.RED = cc.c3(255,0,0); +cc.GREEN = cc.c3(0,255,0); +cc.BLUE = cc.c3(0,0,255); +cc.BLACK = cc.c3(0,0,0); +cc.WHITE = cc.c3(255,255,255); + +cc.POINT_ZERO = {x:0, y:0}; + +cc._reuse_p0 = {x:0, y:0}; +cc._reuse_p1 = {x:0, y:0}; +cc._reuse_p_index = 0; +cc._reuse_color3b = cc.c3(255, 255, 255 ); +cc._reuse_color4b = cc.c4(255, 255, 255, 255 ); +cc._reuse_grid = cc.g(0,0); + +// dump config info, but only in debug mode +cc.dumpConfig = function() +{ + if( cc.config.debug ) { + for(var i in cc.config) + cc.log( i + " = " + cc.config[i] ); + } +}; + +// +// Point +// +cc._p = function( x, y ) +{ + if( cc._reuse_p_index === 0 ) { + cc._reuse_p0.x = x; + cc._reuse_p0.y = y; + cc._reuse_p_index = 1; + return cc._reuse_p0; + } else { + cc._reuse_p1.x = x; + cc._reuse_p1.y = y; + cc._reuse_p_index = 0; + return cc._reuse_p1; + } +}; + +cc._to_p = function( point ) +{ + return point; +}; + +cc._from_p = function( size ) +{ + return size; +}; + +// +// Grid +// +cc._g = function( x, y ) +{ + cc._reuse_grid.x = x; + cc._reuse_grid.y = y; + return cc._reuse_grid; +} + +// +// Color +// +// +// Color 3B +// +cc.c3b = function( r, g, b ) +{ + return {r:r, g:g, b:b }; +}; +cc._c3b = function( r, g, b ) +{ + cc._reuse_color3b.r = r; + cc._reuse_color3b.g = g; + cc._reuse_color3b.b = b; + return cc._reuse_color3b; +}; +// compatibility +cc.c3 = cc.c3b; +cc._c3 = cc._c3b; + +// +// Color 4B +// +cc.c4b = function( r, g, b, a ) +{ + return {r:r, g:g, b:b, a:a }; +}; +cc._c4b = function( r, g, b, a ) +{ + cc._reuse_color4b.r = r; + cc._reuse_color4b.g = g; + cc._reuse_color4b.b = b; + cc._reuse_color4b.a = a; + return cc._reuse_color4b; +}; +// compatibility +cc.c4 = cc.c4b; +cc._c4 = cc._c4b; + + +// +// Size +// +cc.size = function(w,h) +{ + return {width:w, height:h}; +} + +cc._to_size = function( size ) +{ + return size; +} + +cc._from_size = function( size ) +{ + return size; +} + +// +// Rect +// +cc.rect = function(x,y,w,h) +{ + return {x:x, y:y, width:w, height:h}; +} + +cc._to_rect = function( rect ) +{ + return rect; +} + +cc._from_rect = function( rect ) +{ + return rect; +} + +// XXX Should be done in native +cc.rectIntersectsRect = function( rectA, rectB ) +{ + var bool = ! ( rectA.x > rectB.x + rectB.width || + rectA.x + rectA.width < rectB.x || + rectA.y > rectB.y +rectB.height || + rectA.y + rectA.height < rectB.y ); + + return bool; +} + +// point functions +cc.pAdd = cc.pAdd || function (p1, p2) { + return {x: p1.x + p2.x, y: p1.y + p2.y}; +}; + +cc.pSub = cc.pSub || function (p1, p2) { + return {x: p1.x - p2.x, y: p1.y - p2.y}; +} + +cc.pMult = cc.pMult || function (p1, s) { + return {x: p1.x * s, y: p1.y * s}; +}; + +/** + * Calculates dot product of two points. + * @param {cc.Point} v1 + * @param {cc.Point} v2 + * @return {Number} + */ +cc.pDot = function (v1, v2) { + return v1.x * v2.x + v1.y * v2.y; +}; + +/** + * Calculates the square length of a cc.Point (not calling sqrt() ) + * @param {cc.Point} v + *@return {cc.pDot} + */ +cc.pLengthSQ = function (v) { + return cc.pDot(v, v); +}; + +/** + * Calculates distance between point an origin + * @param {cc.Point} v + * @return {Number} + */ +cc.pLength = function (v) { + return Math.sqrt(cc.pLengthSQ(v)); +}; + +/** + * Calculates the distance between two points + * @param {cc.Point} v1 + * @param {cc.Point} v2 + * @return {cc.pLength} + */ +cc.pDistance = function (v1, v2) { + return cc.pLength(cc.pSub(v1, v2)); +}; + +/** + * Clamp a value between from and to. + * @param {Number} value + * @param {Number} min_inclusive + * @param {Number} max_inclusive + * @return {Number} + */ +cc.clampf = function (value, min_inclusive, max_inclusive) { + if (min_inclusive > max_inclusive) { + var temp = min_inclusive; + min_inclusive = max_inclusive; + max_inclusive = temp; + } + return value < min_inclusive ? min_inclusive : value < max_inclusive ? value : max_inclusive; +}; + +/** + * Clamp a point between from and to. + * @param {Number} p + * @param {Number} min_inclusive + * @param {Number} max_inclusive + * @return {cc.Point} + */ +cc.pClamp = function (p, min_inclusive, max_inclusive) { + return cc.p(cc.clampf(p.x, min_inclusive.x, max_inclusive.x), cc.clampf(p.y, min_inclusive.y, max_inclusive.y)); +}; + +/** + * returns a random float between 0 and 1 + * @return {Number} + * @function + */ +cc.RANDOM_0_1 = function () { + return Math.random(); +}; + +/** + * Associates a base class with a native superclass + * @function + * @param {object} jsobj subclass + * @param {object} klass superclass + */ +cc.associateWithNative = function( jsobj, superclass ) { + var native = new superclass(); + __associateObjWithNative( jsobj, native ); +}; + +// +// Array: for cocos2d-hmtl5 compatibility +// +cc.ArrayRemoveObject = function (arr, delObj) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == delObj) { + arr.splice(i, 1); + } + } +}; + +// +// Google "subclasses" +// borrowed from closure library +// +var goog = goog || {}; // Check to see if already defined in current scope +goog.inherits = function (childCtor, parentCtor) { + /** @constructor */ + function tempCtor() {}; + tempCtor.prototype = parentCtor.prototype; + childCtor.superClass_ = parentCtor.prototype; + childCtor.prototype = new tempCtor(); + childCtor.prototype.constructor = childCtor; + + // Copy "static" method, but doesn't generate subclasses. +// for( var i in parentCtor ) { +// childCtor[ i ] = parentCtor[ i ]; +// } +}; +goog.base = function(me, opt_methodName, var_args) { + var caller = arguments.callee.caller; + if (caller.superClass_) { + // This is a constructor. Call the superclass constructor. + ret = caller.superClass_.constructor.apply( me, Array.prototype.slice.call(arguments, 1)); + + // XXX: SpiderMonkey bindings extensions +// __associateObjWithNative( me, ret ); + return ret; + } + + var args = Array.prototype.slice.call(arguments, 2); + var foundCaller = false; + for (var ctor = me.constructor; + ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) { + if (ctor.prototype[opt_methodName] === caller) { + foundCaller = true; + } else if (foundCaller) { + return ctor.prototype[opt_methodName].apply(me, args); + } + } + + // If we did not find the caller in the prototype chain, + // then one of two things happened: + // 1) The caller is an instance method. + // 2) This method was not called by the right caller. + if (me[opt_methodName] === caller) { + return me.constructor.prototype[opt_methodName].apply(me, args); + } else { + throw Error( + 'goog.base called from a method of one name ' + + 'to a method of a different name'); + } +}; + + +// +// Simple subclass +// + +cc.Class = function(){}; + +cc.Class.extend = function (prop) { + var _super = this.prototype; + + // Instantiate a base class (but only create the instance, + // don't run the init constructor) + initializing = true; + var prototype = new this(); + initializing = false; + fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; + + // Copy the properties over onto the new prototype + for (var name in prop) { + // Check if we're overwriting an existing function + prototype[name] = typeof prop[name] == "function" && + typeof _super[name] == "function" && fnTest.test(prop[name]) ? + (function (name, fn) { + return function () { + var tmp = this._super; + + // Add a new ._super() method that is the same method + // but on the super-class + this._super = _super[name]; + + // The method only need to be bound temporarily, so we + // remove it when we're done executing + var ret = fn.apply(this, arguments); + this._super = tmp; + + return ret; + }; + })(name, prop[name]) : + prop[name]; + } + + // The dummy class constructor + function Class() { + // All construction is actually done in the init method + if (!initializing && this.ctor) + this.ctor.apply(this, arguments); + } + + // Populate our constructed prototype object + Class.prototype = prototype; + + // Enforce the constructor to be what we expect + Class.prototype.constructor = Class; + + // And make this class extendable + Class.extend = arguments.callee; + + return Class; +}; + +cc.Layer.extend = cc.Class.extend; +cc.Scene.extend = cc.Class.extend; +cc.LayerGradient.extend = cc.Class.extend; +cc.Sprite.extend = cc.Class.extend; +cc.MenuItemFont.extend = cc.Class.extend; + +// +// Chipmunk helpers +// +var cp = cp || {}; + +cp.v = cc.p; +cp._v = cc._p; +cp.vzero = cp.v(0,0); + +// +// OpenGL Helpers +// +var gl = gl || {}; +gl.NEAREST = 0x2600; +gl.LINEAR = 0x2601; +gl.REPEAT = 0x2901; +gl.CLAMP_TO_EDGE = 0x812F; +gl.CLAMP_TO_BORDER = 0x812D; +gl.LINEAR_MIPMAP_NEAREST = 0x2701; +gl.NEAREST_MIPMAP_NEAREST = 0x2700; +gl.ZERO = 0; +gl.ONE = 1; +gl.SRC_COLOR = 0x0300; +gl.ONE_MINUS_SRC_COLOR = 0x0301; +gl.SRC_ALPHA = 0x0302; +gl.ONE_MINUS_SRC_ALPHA = 0x0303; +gl.DST_ALPHA = 0x0304; +gl.ONE_MINUS_DST_ALPHA = 0x0305; +gl.DST_COLOR = 0x0306; +gl.ONE_MINUS_DST_COLOR = 0x0307; +gl.SRC_ALPHA_SATURATE = 0x0308; + diff --git a/samples/TestJavascript/Resources/js/jsb_constants_gl.js b/samples/TestJavascript/Resources/js/jsb_constants_gl.js new file mode 100644 index 0000000000..8b9d2f701d --- /dev/null +++ b/samples/TestJavascript/Resources/js/jsb_constants_gl.js @@ -0,0 +1,23 @@ +// +// OpenGL defines +// + +var gl = gl || {}; +gl.NEAREST = 0x2600; +gl.LINEAR = 0x2601; +gl.REPEAT = 0x2901; +gl.CLAMP_TO_EDGE = 0x812F; +gl.CLAMP_TO_BORDER = 0x812D; +gl.LINEAR_MIPMAP_NEAREST = 0x2701; +gl.NEAREST_MIPMAP_NEAREST = 0x2700; +gl.ZERO = 0; +gl.ONE = 1; +gl.SRC_COLOR = 0x0300; +gl.ONE_MINUS_SRC_COLOR = 0x0301; +gl.SRC_ALPHA = 0x0302; +gl.ONE_MINUS_SRC_ALPHA = 0x0303; +gl.DST_ALPHA = 0x0304; +gl.ONE_MINUS_DST_ALPHA = 0x0305; +gl.DST_COLOR = 0x0306; +gl.ONE_MINUS_DST_COLOR = 0x0307; +gl.SRC_ALPHA_SATURATE = 0x0308;