issue #1469: Made MoonWarriors works on iOS.

This commit is contained in:
James Chen 2012-10-10 22:06:44 +08:00
parent 26a5f31f0e
commit 36d8e86879
29 changed files with 339 additions and 1027 deletions

View File

@ -5,7 +5,6 @@
#include "ScriptingCore.h"
#include "generated/cocos2dx.hpp"
#include "cocos2d_specifics.hpp"
#include "js_bindings_chipmunk_manual.hpp"
USING_NS_CC;
using namespace CocosDenshion;
@ -42,7 +41,7 @@ bool AppDelegate::applicationDidFinishLaunching()
CCScriptEngineProtocol *pEngine = ScriptingCore::getInstance();
CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine);
ScriptingCore::getInstance()->runScript("MoonWarriors/MoonWarriors-native.js");
ScriptingCore::getInstance()->runScript("js/MoonWarriors-native.js");
return true;
}

View File

@ -26,27 +26,27 @@
// boot code needed for cocos2d + JS bindings.
// Not needed by cocos2d-html5
require("jshelper/jsb_constants.js");
require("js/helper/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'
'js/Resource.js',
'js/config/GameConfig.js',
'js/config/EnemyType.js',
'js/config/Level.js',
'js/Effect.js',
'js/Bullet.js',
'js/Enemy.js',
'js/Explosion.js',
'js/Ship.js',
'js/LevelManager.js',
'js/GameControlMenu.js',
'js/GameLayer.js',
'js/GameOver.js',
'js/AboutLayer.js',
'js/SettingsLayer.js',
'js/SysMenu.js'
];
cc.dumpConfig();

View File

@ -1,11 +1,16 @@
var dirImg = "";
var dirMusic = "";
var musicSuffix = ".mp3";
if( cc.config.deviceType == 'browser' || cc.config.engine == 'cocos2d-x') {
dirImg = "MoonWarriors/res/";
dirMusic = "MoonWarriors/res/Music/";
if( cc.config.deviceType == 'browser') {
dirImg = "res/";
dirMusic = "res/Music/";
musicSuffix = "";
}
else if( cc.config.engine == 'cocos2d-x') {
dirImg = "res/";
dirMusic = "res/Music/";
musicSuffix = ".mp3";
}
//image
var s_bg01 = dirImg + "bg01.jpg";

View File

@ -1,4 +1,4 @@
require('jshelper/jsb_constants_gl.js');
require('js/helper/jsb_constants_gl.js');
// cocos2d Helper
cc.c3 = cc.c3 || function (r, g, b) {