├── README.md ├── 发布说明.txt ├── 安装包 ├── Android │ └── Moonwarriors.apk └── Windows │ ├── glew32.dll │ ├── libcurl.dll │ ├── libtiff.dll │ ├── moonwarriors.exe │ ├── msvcp110.dll │ ├── msvcr110.dll │ ├── pthreadVCE2.dll │ ├── res │ ├── Image │ │ ├── arial-14.fnt │ │ ├── arial-14.png │ │ ├── b01.plist │ │ ├── b01.png │ │ ├── cocos2d-html5.png │ │ ├── explode.plist │ │ ├── explosion.plist │ │ ├── explosion.png │ │ ├── flare.jpg │ │ ├── gameOver.png │ │ ├── level01.tmx │ │ ├── loading.png │ │ ├── logo.png │ │ ├── menu.png │ │ ├── menuTitle.png │ │ ├── textureOpaquePack.plist │ │ ├── textureOpaquePack.png │ │ ├── textureTransparentPack.plist │ │ └── textureTransparentPack.png │ ├── Music │ │ ├── bgMusic.mp3 │ │ ├── buttonEffet.mp3 │ │ ├── explodeEffect.mp3 │ │ ├── fireEffect.mp3 │ │ ├── mainMainMusic.mp3 │ │ └── shipDestroyEffect.mp3 │ ├── framework_precompiled.zip │ └── game.zip │ ├── websockets.dll │ └── zlib1.dll ├── 源代码 └── moonwarriors │ ├── .buildpath │ ├── .cocos-project.json │ ├── .project │ ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── version.json │ ├── config.json │ ├── debug.log │ ├── proj.android │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.jdt.core.prefs │ ├── AndroidManifest.xml │ ├── bin │ │ ├── AndroidManifest.xml │ │ ├── R.txt │ │ ├── classes │ │ │ └── com │ │ │ │ └── zym │ │ │ │ └── moonwarriors │ │ │ │ ├── BuildConfig.class │ │ │ │ ├── Moonwarriors.class │ │ │ │ ├── R$attr.class │ │ │ │ ├── R$drawable.class │ │ │ │ ├── R$string.class │ │ │ │ └── R.class │ │ ├── dexedLibs │ │ │ └── libcocos2dx-70b5900cfa40c886c548a44cc22017bb.jar │ │ └── res │ │ │ └── crunch │ │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ │ └── drawable-mdpi │ │ │ └── icon.png │ ├── build_native.bat │ ├── build_native.sh │ ├── clean.bat │ ├── clean.sh │ ├── gen │ │ └── com │ │ │ └── zym │ │ │ └── moonwarriors │ │ │ ├── BuildConfig.java │ │ │ └── R.java │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ ├── hellocpp │ │ │ └── main.cpp │ │ └── list.sh │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── zym │ │ └── moonwarriors │ │ └── Moonwarriors.java │ ├── proj.ios │ ├── AppController.h │ ├── AppController.mm │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-72.png │ │ ├── Icon.png │ │ ├── Icon@2x.png │ │ └── Info.plist │ ├── RootViewController.h │ ├── RootViewController.mm │ ├── main.m │ └── moonwarriors.xcodeproj │ │ └── project.pbxproj │ ├── proj.mac │ ├── AppController.h │ ├── AppController.mm │ ├── Icon.icns │ ├── Info.plist │ ├── MainMenu.xib │ ├── main.m │ └── moonwarriors.xcodeproj │ │ └── project.pbxproj │ ├── proj.win32 │ ├── app.cpp │ ├── app.h │ ├── app.ico │ ├── app.rc │ ├── debug.log │ ├── moonwarriors.sln │ ├── moonwarriors.v11.suo │ ├── moonwarriors.vcxproj │ ├── moonwarriors.vcxproj.filters │ ├── moonwarriors.vcxproj.user │ ├── resource.h │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h │ ├── res │ ├── Image │ │ ├── arial-14.fnt │ │ ├── arial-14.png │ │ ├── b01.plist │ │ ├── b01.png │ │ ├── cocos2d-html5.png │ │ ├── explode.plist │ │ ├── explosion.plist │ │ ├── explosion.png │ │ ├── flare.jpg │ │ ├── gameOver.png │ │ ├── level01.tmx │ │ ├── loading.png │ │ ├── logo.png │ │ ├── menu.png │ │ ├── menuTitle.png │ │ ├── textureOpaquePack.plist │ │ ├── textureOpaquePack.png │ │ ├── textureTransparentPack.plist │ │ └── textureTransparentPack.png │ ├── ImageRaw │ │ ├── arial-14.GlyphProject │ │ ├── arial-14.fnt │ │ ├── arial-14.png │ │ ├── b01.plist │ │ ├── b01.png │ │ ├── cocos2d-html5.png │ │ ├── explode.plist │ │ ├── explosion.plist │ │ ├── explosion.png │ │ ├── flare.jpg │ │ ├── gameOver.png │ │ ├── level01.tmx │ │ ├── loading.png │ │ ├── logo.png │ │ ├── menu.png │ │ ├── menuTitle.png │ │ ├── textureOpaquePack.plist │ │ ├── textureOpaquePack.png │ │ ├── textureTransparentPack.plist │ │ └── textureTransparentPack.png │ ├── Music │ │ ├── bgMusic.mp3 │ │ ├── bgMusic.ogg │ │ ├── buttonEffet.mp3 │ │ ├── buttonEffet.ogg │ │ ├── explodeEffect.mp3 │ │ ├── explodeEffect.ogg │ │ ├── fireEffect.mp3 │ │ ├── fireEffect.ogg │ │ ├── mainMainMusic.mp3 │ │ ├── mainMainMusic.ogg │ │ ├── shipDestroyEffect.mp3 │ │ └── shipDestroyEffect.ogg │ ├── framework_precompiled.zip │ └── game.zip │ ├── run-mac.sh │ ├── run-win.bat │ ├── scripts │ ├── Background.lua │ ├── Bullet.lua │ ├── Effect.lua │ ├── Enemy.lua │ ├── Explosion.lua │ ├── HitEffect.lua │ ├── LevelManager.lua │ ├── Ship.lua │ ├── SparkEffect.lua │ ├── app │ │ ├── MyApp.lua │ │ └── scenes │ │ │ ├── AboutScene.lua │ │ │ ├── GameOverScene.lua │ │ │ ├── MainScene.lua │ │ │ ├── SettingsScene.lua │ │ │ └── SysMenuScene.lua │ ├── config.lua │ ├── config │ │ ├── EnemyType.lua │ │ ├── GameConfig.lua │ │ └── Level.lua │ └── main.lua │ └── sources │ ├── AppDelegate.cpp │ └── AppDelegate.h └── 界面截图 ├── 主界面.png ├── 关于.png ├── 开始菜单.png ├── 游戏结束.png └── 设置.png /README.md: -------------------------------------------------------------------------------- 1 | MoonWarriors-lua 2 | ================ 3 | MoonWarriors是一个使用Cocos2d-Html5引擎开发的类似雷电战机的游戏Demo,源代码发布在Cocos2d-x官网的引擎示例当中。MoonWarriors-lua是为了学习Cocos2d-x Lua开发而移植的Quick-Cocos2d-x版本。移植过程中,体验了一回JS代码到Lua代码的各自语法特性。
4 | 5 | 1、增加了屏幕分辨率适配。
6 | 2、修复了原版本的偶尔屏幕卡顿问题。
7 | 8 | 界面载图:
9 | ![image](https://github.com/zym2014/MoonWarriors-lua/blob/master/%E7%95%8C%E9%9D%A2%E6%88%AA%E5%9B%BE/%E5%BC%80%E5%A7%8B%E8%8F%9C%E5%8D%95.png) 10 | ![image](https://github.com/zym2014/MoonWarriors-lua/blob/master/%E7%95%8C%E9%9D%A2%E6%88%AA%E5%9B%BE/%E4%B8%BB%E7%95%8C%E9%9D%A2.png)
11 | ![image](https://github.com/zym2014/MoonWarriors-lua/blob/master/%E7%95%8C%E9%9D%A2%E6%88%AA%E5%9B%BE/%E6%B8%B8%E6%88%8F%E7%BB%93%E6%9D%9F.png) 12 | ![image](https://github.com/zym2014/MoonWarriors-lua/blob/master/%E7%95%8C%E9%9D%A2%E6%88%AA%E5%9B%BE/%E8%AE%BE%E7%BD%AE.png)
13 | ![image](https://github.com/zym2014/MoonWarriors-lua/blob/master/%E7%95%8C%E9%9D%A2%E6%88%AA%E5%9B%BE/%E5%85%B3%E4%BA%8E.png)
14 | 15 | 开发环境:
16 | Quick-Cocos2d-x-2.2.5
17 | Cocos Code IDE
18 | 19 | 注意:
20 | 在Windows下面运行不能将程序放在中文目录下,否则会播放不了声音,这是引擎的Bug。
21 | 22 | 项目地址:
23 | [https://github.com/zym2014/MoonWarriors-lua](https://github.com/zym2014/MoonWarriors-lua)
24 | 25 | 作者Blog:
26 | [http://zym.cnblogs.com](http://zym.cnblogs.com)
27 | [http://blog.csdn.net/zym_123456](http://blog.csdn.net/zym_123456)
28 | -------------------------------------------------------------------------------- /发布说明.txt: -------------------------------------------------------------------------------- 1 | MoonWarriors-lua 2 | 3 | MoonWarriors是一个使用Cocos2d-Html5引擎开发的类似雷电战机的游戏Demo,源代码发布在Cocos2d-x官网的引擎示例当中。MoonWarriors-lua是为了学习Cocos2d-x Lua开发而移植的Quick-Cocos2d-x版本。移植过程中,体验了一回JS代码到Lua代码的各自语法特性。 4 | 5 | 1、增加了屏幕分辨率适配。 6 | 2、修复了原版本的偶尔屏幕卡顿问题。 7 | 8 | 开发环境: 9 | Quick-Cocos2d-x-2.2.5 10 | Cocos Code IDE 11 | 12 | 注意: 13 | 在Windows下面运行不能将程序放在中文目录下,否则会播放不了声音,这是引擎的Bug。 14 | 15 | 项目地址: 16 | https://github.com/zym2014/MoonWarriors-lua 17 | 18 | 19 | 作者Blog: 20 | http://zym.cnblogs.com 21 | http://blog.csdn.net/zym_123456 -------------------------------------------------------------------------------- /安装包/Android/Moonwarriors.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Android/Moonwarriors.apk -------------------------------------------------------------------------------- /安装包/Windows/glew32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/glew32.dll -------------------------------------------------------------------------------- /安装包/Windows/libcurl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/libcurl.dll -------------------------------------------------------------------------------- /安装包/Windows/libtiff.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/libtiff.dll -------------------------------------------------------------------------------- /安装包/Windows/moonwarriors.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/moonwarriors.exe -------------------------------------------------------------------------------- /安装包/Windows/msvcp110.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/msvcp110.dll -------------------------------------------------------------------------------- /安装包/Windows/msvcr110.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/msvcr110.dll -------------------------------------------------------------------------------- /安装包/Windows/pthreadVCE2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/pthreadVCE2.dll -------------------------------------------------------------------------------- /安装包/Windows/res/Image/arial-14.fnt: -------------------------------------------------------------------------------- 1 | info face="ArialMT" size=14 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 2 | common lineHeight=15 base=13 scaleW=256 scaleH=128 pages=1 packed=0 3 | page id=0 file="arial-14.png" 4 | chars count=95 5 | char id=64 x=2 y=2 width=18 height=18 xoffset=-1 yoffset=1 xadvance=14 page=0 chnl=0 letter="@" 6 | char id=123 x=22 y=2 width=9 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="{" 7 | char id=125 x=33 y=2 width=9 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="}" 8 | char id=40 x=44 y=2 width=8 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="(" 9 | char id=41 x=54 y=2 width=8 height=18 xoffset=0 yoffset=1 xadvance=5 page=0 chnl=0 letter=")" 10 | char id=124 x=64 y=2 width=6 height=18 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=0 letter="|" 11 | char id=36 x=72 y=2 width=12 height=17 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="$" 12 | char id=106 x=86 y=2 width=8 height=17 xoffset=-2 yoffset=2 xadvance=3 page=0 chnl=0 letter="j" 13 | char id=91 x=96 y=2 width=8 height=17 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="[" 14 | char id=93 x=106 y=2 width=7 height=17 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="]" 15 | char id=37 x=115 y=2 width=16 height=16 xoffset=-1 yoffset=1 xadvance=12 page=0 chnl=0 letter="%" 16 | char id=81 x=133 y=2 width=15 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="Q" 17 | char id=79 x=150 y=2 width=15 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="O" 18 | char id=71 x=167 y=2 width=14 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="G" 19 | char id=67 x=183 y=2 width=14 height=16 xoffset=-1 yoffset=1 xadvance=10 page=0 chnl=0 letter="C" 20 | char id=38 x=199 y=2 width=13 height=16 xoffset=-1 yoffset=1 xadvance=9 page=0 chnl=0 letter="&" 21 | char id=83 x=214 y=2 width=13 height=16 xoffset=-1 yoffset=1 xadvance=9 page=0 chnl=0 letter="S" 22 | char id=35 x=229 y=2 width=12 height=16 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="#" 23 | char id=47 x=243 y=2 width=8 height=16 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="/" 24 | char id=92 x=2 y=22 width=8 height=16 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="\" 25 | char id=85 x=12 y=22 width=12 height=15 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="U" 26 | char id=51 x=26 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="3" 27 | char id=53 x=40 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="5" 28 | char id=54 x=54 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="6" 29 | char id=56 x=68 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="8" 30 | char id=57 x=82 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="9" 31 | char id=48 x=96 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="0" 32 | char id=63 x=110 y=22 width=12 height=15 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="?" 33 | char id=98 x=124 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="b" 34 | char id=112 x=138 y=22 width=12 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="p" 35 | char id=121 x=152 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="y" 36 | char id=103 x=165 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="g" 37 | char id=100 x=178 y=22 width=11 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="d" 38 | char id=113 x=191 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="q" 39 | char id=74 x=204 y=22 width=10 height=15 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 letter="J" 40 | char id=102 x=216 y=22 width=9 height=15 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="f" 41 | char id=116 x=227 y=22 width=8 height=15 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="t" 42 | char id=87 x=237 y=22 width=17 height=14 xoffset=-1 yoffset=2 xadvance=13 page=0 chnl=0 letter="W" 43 | char id=77 x=2 y=40 width=14 height=14 xoffset=0 yoffset=2 xadvance=12 page=0 chnl=0 letter="M" 44 | char id=65 x=18 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="A" 45 | char id=86 x=34 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="V" 46 | char id=88 x=50 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="X" 47 | char id=89 x=66 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="Y" 48 | char id=82 x=82 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="R" 49 | char id=68 x=97 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="D" 50 | char id=75 x=112 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="K" 51 | char id=84 x=127 y=40 width=13 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="T" 52 | char id=90 x=142 y=40 width=13 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="Z" 53 | char id=72 x=157 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="H" 54 | char id=78 x=171 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="N" 55 | char id=66 x=185 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="B" 56 | char id=80 x=199 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="P" 57 | char id=69 x=213 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="E" 58 | char id=52 x=227 y=40 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="4" 59 | char id=50 x=241 y=40 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="2" 60 | char id=55 x=2 y=56 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="7" 61 | char id=70 x=16 y=56 width=11 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="F" 62 | char id=76 x=29 y=56 width=11 height=14 xoffset=0 yoffset=2 xadvance=8 page=0 chnl=0 letter="L" 63 | char id=104 x=42 y=56 width=11 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="h" 64 | char id=107 x=55 y=56 width=11 height=14 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 letter="k" 65 | char id=49 x=68 y=56 width=9 height=14 xoffset=0 yoffset=2 xadvance=8 page=0 chnl=0 letter="1" 66 | char id=105 x=79 y=56 width=7 height=14 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="i" 67 | char id=108 x=88 y=56 width=7 height=14 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="l" 68 | char id=73 x=97 y=56 width=6 height=14 xoffset=0 yoffset=2 xadvance=4 page=0 chnl=0 letter="I" 69 | char id=33 x=105 y=56 width=6 height=14 xoffset=0 yoffset=2 xadvance=4 page=0 chnl=0 letter="!" 70 | char id=59 x=113 y=56 width=6 height=14 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter=";" 71 | char id=111 x=121 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="o" 72 | char id=97 x=135 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="a" 73 | char id=101 x=149 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="e" 74 | char id=99 x=163 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="c" 75 | char id=115 x=176 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="s" 76 | char id=117 x=189 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="u" 77 | char id=109 x=202 y=56 width=15 height=12 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 letter="m" 78 | char id=119 x=219 y=56 width=14 height=12 xoffset=-1 yoffset=4 xadvance=10 page=0 chnl=0 letter="w" 79 | char id=60 x=235 y=56 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter="<" 80 | char id=62 x=2 y=72 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter=">" 81 | char id=43 x=16 y=72 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter="+" 82 | char id=118 x=30 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="v" 83 | char id=120 x=43 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="x" 84 | char id=122 x=56 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="z" 85 | char id=110 x=69 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="n" 86 | char id=114 x=82 y=72 width=9 height=12 xoffset=-1 yoffset=4 xadvance=5 page=0 chnl=0 letter="r" 87 | char id=58 x=93 y=72 width=6 height=12 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter=":" 88 | char id=94 x=101 y=72 width=11 height=11 xoffset=-1 yoffset=1 xadvance=7 page=0 chnl=0 letter="^" 89 | char id=61 x=114 y=72 width=12 height=10 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="=" 90 | char id=42 x=128 y=72 width=9 height=9 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="*" 91 | char id=34 x=139 y=72 width=9 height=8 xoffset=-1 yoffset=2 xadvance=5 page=0 chnl=0 letter=""" 92 | char id=39 x=150 y=72 width=6 height=8 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="'" 93 | char id=44 x=158 y=72 width=6 height=8 xoffset=0 yoffset=10 xadvance=4 page=0 chnl=0 letter="," 94 | char id=126 x=166 y=72 width=12 height=7 xoffset=-1 yoffset=6 xadvance=8 page=0 chnl=0 letter="~" 95 | char id=96 x=180 y=72 width=8 height=7 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="`" 96 | char id=95 x=190 y=72 width=13 height=6 xoffset=-2 yoffset=13 xadvance=8 page=0 chnl=0 letter="_" 97 | char id=45 x=205 y=72 width=9 height=6 xoffset=-1 yoffset=7 xadvance=5 page=0 chnl=0 letter="-" 98 | char id=46 x=216 y=72 width=6 height=6 xoffset=0 yoffset=10 xadvance=4 page=0 chnl=0 letter="." 99 | char id=32 x=224 y=72 width=0 height=0 xoffset=0 yoffset=133 xadvance=4 page=0 chnl=0 letter="space" 100 | kernings count=82 101 | kerning first=64 second=42 amount=-1 102 | kerning first=79 second=102 amount=-1 103 | kerning first=79 second=82 amount=-1 104 | kerning first=47 second=52 amount=-1 105 | kerning first=63 second=126 amount=-1 106 | kerning first=121 second=44 amount=-1 107 | kerning first=121 second=46 amount=-1 108 | kerning first=87 second=65 amount=-1 109 | kerning first=87 second=97 amount=-1 110 | kerning first=87 second=44 amount=-1 111 | kerning first=87 second=46 amount=-1 112 | kerning first=65 second=87 amount=-1 113 | kerning first=65 second=86 amount=-1 114 | kerning first=65 second=89 amount=-1 115 | kerning first=65 second=84 amount=-1 116 | kerning first=65 second=32 amount=-1 117 | kerning first=86 second=121 amount=-1 118 | kerning first=86 second=65 amount=-1 119 | kerning first=86 second=59 amount=-1 120 | kerning first=86 second=111 amount=-1 121 | kerning first=86 second=97 amount=-1 122 | kerning first=86 second=101 amount=-1 123 | kerning first=86 second=117 amount=-1 124 | kerning first=86 second=114 amount=-1 125 | kerning first=86 second=58 amount=-1 126 | kerning first=86 second=44 amount=-1 127 | kerning first=86 second=45 amount=-1 128 | kerning first=86 second=46 amount=-1 129 | kerning first=89 second=112 amount=-1 130 | kerning first=89 second=113 amount=-1 131 | kerning first=89 second=65 amount=-1 132 | kerning first=89 second=105 amount=-1 133 | kerning first=89 second=59 amount=-1 134 | kerning first=89 second=111 amount=-1 135 | kerning first=89 second=97 amount=-1 136 | kerning first=89 second=101 amount=-1 137 | kerning first=89 second=117 amount=-1 138 | kerning first=89 second=118 amount=-1 139 | kerning first=89 second=58 amount=-1 140 | kerning first=89 second=44 amount=-2 141 | kerning first=89 second=45 amount=-1 142 | kerning first=89 second=46 amount=-2 143 | kerning first=84 second=121 amount=-1 144 | kerning first=84 second=65 amount=-1 145 | kerning first=84 second=105 amount=-1 146 | kerning first=84 second=59 amount=-2 147 | kerning first=84 second=111 amount=-2 148 | kerning first=84 second=97 amount=-2 149 | kerning first=84 second=101 amount=-2 150 | kerning first=84 second=99 amount=-2 151 | kerning first=84 second=115 amount=-2 152 | kerning first=84 second=117 amount=-1 153 | kerning first=84 second=119 amount=-1 154 | kerning first=84 second=114 amount=-1 155 | kerning first=84 second=58 amount=-2 156 | kerning first=84 second=44 amount=-2 157 | kerning first=84 second=45 amount=-1 158 | kerning first=84 second=46 amount=-2 159 | kerning first=80 second=65 amount=-1 160 | kerning first=80 second=62 amount=-1 161 | kerning first=80 second=44 amount=-2 162 | kerning first=80 second=46 amount=-2 163 | kerning first=70 second=65 amount=-1 164 | kerning first=70 second=44 amount=-2 165 | kerning first=70 second=46 amount=-2 166 | kerning first=76 second=121 amount=-1 167 | kerning first=76 second=87 amount=-1 168 | kerning first=76 second=86 amount=-1 169 | kerning first=76 second=89 amount=-1 170 | kerning first=76 second=84 amount=-1 171 | kerning first=76 second=32 amount=-1 172 | kerning first=49 second=49 amount=-1 173 | kerning first=33 second=102 amount=-1 174 | kerning first=119 second=44 amount=-1 175 | kerning first=119 second=46 amount=-1 176 | kerning first=62 second=35 amount=-1 177 | kerning first=118 second=44 amount=-1 178 | kerning first=118 second=46 amount=-1 179 | kerning first=114 second=44 amount=-1 180 | kerning first=114 second=46 amount=-1 181 | kerning first=32 second=92 amount=-1 182 | kerning first=32 second=65 amount=-1 183 | -------------------------------------------------------------------------------- /安装包/Windows/res/Image/arial-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/arial-14.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/b01.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/b01.plist -------------------------------------------------------------------------------- /安装包/Windows/res/Image/b01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/b01.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/cocos2d-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/cocos2d-html5.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/explode.plist: -------------------------------------------------------------------------------- 1 | XXTEA -------------------------------------------------------------------------------- /安装包/Windows/res/Image/explosion.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/explosion.plist -------------------------------------------------------------------------------- /安装包/Windows/res/Image/explosion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/explosion.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/flare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/flare.jpg -------------------------------------------------------------------------------- /安装包/Windows/res/Image/gameOver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/gameOver.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/level01.tmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/level01.tmx -------------------------------------------------------------------------------- /安装包/Windows/res/Image/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/loading.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/logo.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/menu.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/menuTitle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/menuTitle.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/textureOpaquePack.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/textureOpaquePack.plist -------------------------------------------------------------------------------- /安装包/Windows/res/Image/textureOpaquePack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/textureOpaquePack.png -------------------------------------------------------------------------------- /安装包/Windows/res/Image/textureTransparentPack.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/textureTransparentPack.plist -------------------------------------------------------------------------------- /安装包/Windows/res/Image/textureTransparentPack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Image/textureTransparentPack.png -------------------------------------------------------------------------------- /安装包/Windows/res/Music/bgMusic.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Music/bgMusic.mp3 -------------------------------------------------------------------------------- /安装包/Windows/res/Music/buttonEffet.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Music/buttonEffet.mp3 -------------------------------------------------------------------------------- /安装包/Windows/res/Music/explodeEffect.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Music/explodeEffect.mp3 -------------------------------------------------------------------------------- /安装包/Windows/res/Music/fireEffect.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Music/fireEffect.mp3 -------------------------------------------------------------------------------- /安装包/Windows/res/Music/mainMainMusic.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Music/mainMainMusic.mp3 -------------------------------------------------------------------------------- /安装包/Windows/res/Music/shipDestroyEffect.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/Music/shipDestroyEffect.mp3 -------------------------------------------------------------------------------- /安装包/Windows/res/framework_precompiled.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/framework_precompiled.zip -------------------------------------------------------------------------------- /安装包/Windows/res/game.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/res/game.zip -------------------------------------------------------------------------------- /安装包/Windows/websockets.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/websockets.dll -------------------------------------------------------------------------------- /安装包/Windows/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/安装包/Windows/zlib1.dll -------------------------------------------------------------------------------- /源代码/moonwarriors/.buildpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /源代码/moonwarriors/.cocos-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "has_native": false, 3 | "project_type": "lua" 4 | } -------------------------------------------------------------------------------- /源代码/moonwarriors/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | moonwarriors 4 | 5 | 6 | 7 | 8 | 9 | 10 | org.ccdt.cocosproject 11 | org.eclipse.koneki.ldt.nature 12 | 13 | 14 | -------------------------------------------------------------------------------- /源代码/moonwarriors/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /源代码/moonwarriors/.settings/version.json: -------------------------------------------------------------------------------- 1 | { 2 | "ideVersion": "1.0.1", 3 | "templateVersion": "1.3", 4 | "runtimeVersion": "1.3", 5 | "engineVersion": "cocos2d-x 3.2" 6 | } -------------------------------------------------------------------------------- /源代码/moonwarriors/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "init_cfg": { 3 | "isLandscape": true, 4 | "name": "moonwarriors", 5 | "width": 960, 6 | "height": 640, 7 | "entry": "scripts/main.lua", 8 | "consolePort": 6010, 9 | "forwardConsolePort": 10089, 10 | "forwardUploadPort": 10091 11 | }, 12 | "simulator_screen_size": [ 13 | { 14 | "title": "iPhone 3Gs (480x320)", 15 | "width": 480, 16 | "height": 320 17 | }, 18 | { 19 | "title": "iPhone 4 (960x640)", 20 | "width": 960, 21 | "height": 640 22 | }, 23 | { 24 | "title": "iPhone 5 (1136x640)", 25 | "width": 1136, 26 | "height": 640 27 | }, 28 | { 29 | "title": "iPad (1024x768)", 30 | "width": 1024, 31 | "height": 768 32 | }, 33 | { 34 | "title": "iPad Retina (2048x1536)", 35 | "width": 2048, 36 | "height": 1536 37 | }, 38 | { 39 | "title": "Android (800x480)", 40 | "width": 800, 41 | "height": 480 42 | }, 43 | { 44 | "title": "Android (854x480)", 45 | "width": 854, 46 | "height": 480 47 | }, 48 | { 49 | "title": "Android (1280x720)", 50 | "width": 1280, 51 | "height": 720 52 | }, 53 | { 54 | "title": "Android (1920x1080)", 55 | "width": 1920, 56 | "height": 1080 57 | } 58 | ] 59 | } -------------------------------------------------------------------------------- /源代码/moonwarriors/debug.log: -------------------------------------------------------------------------------- 1 | 2 | 3 | cocos2d.x.version: quick-cocos2d-x 2.2.5plus 4 | cocos2d.x.compiled_with_profiler: false 5 | cocos2d.x.compiled_with_gl_state_cache: true 6 | gl.vendor: Intel 7 | gl.renderer: Intel(R) HD Graphics 4000 8 | gl.version: 3.3.0 - Build 8.15.10.2778 9 | gl.max_texture_size: 8192 10 | gl.max_texture_units: 16 11 | gl.supports_PVRTC: false 12 | gl.supports_NPOT: true 13 | gl.supports_BGRA8888: false 14 | gl.supports_discard_framebuffer: false 15 | gl.supports_vertex_array_object: true 16 | 17 | lua_loadChunksFromZIP() - load zip file: E:\Demo\cocos2d-x\quick-cocos2d-x-2.2.5\lib\framework_precompiled\framework_precompiled.zip 18 | lua_loadChunksFromZIP() - loaded chunks count: 122 19 | ------------------------------------------------ 20 | LOAD LUA FILE: E:/Demo/cocos2d-x/quick-cocos2d-x-2.2.5/projects/moonwarriors/scripts/main.lua 21 | ------------------------------------------------ 22 | [0.4066] [INFO] 23 | [0.4075] [INFO] # DEBUG = 1 24 | [0.4079] [INFO] # 25 | [0.4087] [INFO] # device.platform = windows 26 | [0.4090] [INFO] # device.model = unknown 27 | [0.4094] [INFO] # device.language = cn 28 | [0.4098] [INFO] # device.writablePath = E:\Demo\cocos2d-x\quick-cocos2d-x-2.2.5\projects\moonwarriors\ 29 | [0.4106] [INFO] # device.cachePath = E:\Demo\cocos2d-x\quick-cocos2d-x-2.2.5\projects\moonwarriors\ 30 | [0.4118] [INFO] # device.directorySeparator = \ 31 | [0.4122] [INFO] # device.pathSeparator = ; 32 | [0.4126] [INFO] # 33 | [0.4148] [INFO] # CONFIG_SCREEN_AUTOSCALE = FIXED_WIDTH 34 | [0.4150] [INFO] # CONFIG_SCREEN_WIDTH = 320.00 35 | [0.4155] [INFO] # CONFIG_SCREEN_HEIGHT = 568.89 36 | [0.4159] [INFO] # display.widthInPixels = 1080.00 37 | [0.4163] [INFO] # display.heightInPixels = 1920.00 38 | [0.4167] [INFO] # display.contentScaleFactor = 3.38 39 | [0.4172] [INFO] # display.width = 320.00 40 | [0.4176] [INFO] # display.height = 568.89 41 | [0.4181] [INFO] # display.cx = 160.00 42 | [0.4185] [INFO] # display.cy = 284.44 43 | [0.4190] [INFO] # display.left = 0.00 44 | [0.4194] [INFO] # display.right = 320.00 45 | [0.4198] [INFO] # display.top = 568.89 46 | [0.4202] [INFO] # display.bottom = 0.00 47 | [0.4214] [INFO] # display.c_left = -160.00 48 | [0.4222] [INFO] # display.c_right = 160.00 49 | [0.4229] [INFO] # display.c_top = 284.44 50 | [0.4233] [INFO] # display.c_bottom = -284.44 51 | [0.4241] [INFO] # 52 | BaseFactory 53 | dragonBones::CCDBManager::printTickCount tickcount:1 thisptr:129391376 msCCDBManager:0, sizeof(128) 96, 20 54 | CCHTTPRequest[0x0001] - create request with url: http://www.google-analytics.com/collect 55 | CCHTTPRequest[0x0001] - request removed 56 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Moonwarriors 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/R.txt: -------------------------------------------------------------------------------- 1 | int drawable icon 0x7f020000 2 | int string app_name 0x7f030000 3 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/BuildConfig.class -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/Moonwarriors.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/Moonwarriors.class -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R$attr.class -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R$drawable.class -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R$string.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R$string.class -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/classes/com/zym/moonwarriors/R.class -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/dexedLibs/libcocos2dx-70b5900cfa40c886c548a44cc22017bb.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/dexedLibs/libcocos2dx-70b5900cfa40c886c548a44cc22017bb.jar -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/res/crunch/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/res/crunch/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/res/crunch/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/res/crunch/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/bin/res/crunch/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/bin/res/crunch/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/build_native.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set DIR=%~dp0 4 | set APP_ROOT=%DIR%..\ 5 | set APP_ANDROID_ROOT=%DIR% 6 | set COCOS2DX_ROOT=%QUICK_COCOS2DX_ROOT%\lib\cocos2d-x 7 | 8 | echo - config: 9 | echo ANDROID_NDK_ROOT = %ANDROID_NDK_ROOT% 10 | echo QUICK_COCOS2DX_ROOT = %QUICK_COCOS2DX_ROOT% 11 | echo COCOS2DX_ROOT = %COCOS2DX_ROOT% 12 | echo APP_ROOT = %APP_ROOT% 13 | echo APP_ANDROID_ROOT = %APP_ANDROID_ROOT% 14 | 15 | rem if dont use DEBUG, comments out two lines below 16 | set NDK_DEBUG=1 17 | set NDK_BUILD_FLAGS=CPPFLAGS="-DCOCOS2D_DEBUG=1" 18 | 19 | echo - cleanup 20 | if exist "%APP_ANDROID_ROOT%bin" rmdir /s /q "%APP_ANDROID_ROOT%bin" 21 | mkdir "%APP_ANDROID_ROOT%bin" 22 | if exist "%APP_ANDROID_ROOT%assets" rmdir /s /q "%APP_ANDROID_ROOT%assets" 23 | mkdir "%APP_ANDROID_ROOT%assets" 24 | 25 | echo - copy scripts 26 | mkdir "%APP_ANDROID_ROOT%assets\scripts" 27 | xcopy /s /q "%APP_ROOT%scripts\*.*" "%APP_ANDROID_ROOT%assets\scripts\" 28 | echo - copy resources 29 | mkdir "%APP_ANDROID_ROOT%assets\res" 30 | xcopy /s /q "%APP_ROOT%res\*.*" "%APP_ANDROID_ROOT%assets\res\" 31 | 32 | echo Using prebuilt externals 33 | "%ANDROID_NDK_ROOT%\ndk-build" %ANDROID_NDK_BUILD_FLAGS% NDK_DEBUG=%NDK_DEBUG% %NDK_BUILD_FLAGS% -C %APP_ANDROID_ROOT% NDK_MODULE_PATH=%QUICK_COCOS2DX_ROOT%;%COCOS2DX_ROOT%;%COCOS2DX_ROOT%\cocos2dx\platform\third_party\android\prebuilt 34 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/build_native.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | APP_ROOT="$DIR/.." 5 | APP_ANDROID_ROOT="$DIR" 6 | COCOS2DX_ROOT=$QUICK_COCOS2DX_ROOT/lib/cocos2d-x 7 | 8 | echo "- config:" 9 | echo " ANDROID_NDK_ROOT = $ANDROID_NDK_ROOT" 10 | echo " QUICK_COCOS2DX_ROOT = $QUICK_COCOS2DX_ROOT" 11 | echo " COCOS2DX_ROOT = $COCOS2DX_ROOT" 12 | echo " APP_ROOT = $APP_ROOT" 13 | echo " APP_ANDROID_ROOT = $APP_ANDROID_ROOT" 14 | 15 | # if dont use DEBUG, comments out two lines below 16 | NDK_DEBUG=1 17 | NDK_BUILD_FLAGS="CPPFLAGS=\"-DCOCOS2D_DEBUG=1\"" 18 | 19 | echo "- cleanup" 20 | find "$APP_ANDROID_ROOT" -type d | xargs chmod 755 $1 21 | if [ -d "$APP_ANDROID_ROOT"/bin ]; then 22 | rm -rf "$APP_ANDROID_ROOT"/bin/*.apk 23 | fi 24 | mkdir -p "$APP_ANDROID_ROOT"/bin 25 | chmod 755 "$APP_ANDROID_ROOT"/bin 26 | 27 | if [ -d "$APP_ANDROID_ROOT"/assets ]; then 28 | rm -rf "$APP_ANDROID_ROOT"/assets/* 29 | fi 30 | mkdir -p "$APP_ANDROID_ROOT"/assets 31 | chmod 755 "$APP_ANDROID_ROOT"/assets 32 | 33 | echo "- copy scripts" 34 | cp -rf "$APP_ROOT"/scripts "$APP_ANDROID_ROOT"/assets/ 35 | echo "- copy resources" 36 | cp -rf "$APP_ROOT"/res "$APP_ANDROID_ROOT"/assets/ 37 | 38 | # build 39 | echo "Using prebuilt externals" 40 | "$ANDROID_NDK_ROOT"/ndk-build $ANDROID_NDK_BUILD_FLAGS NDK_DEBUG=$NDK_DEBUG $NDK_BUILD_FLAGS -C "$APP_ANDROID_ROOT" $* \ 41 | "NDK_MODULE_PATH=${QUICK_COCOS2DX_ROOT}:${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" 42 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/clean.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set DIR=%~dp0 4 | rmdir /s/q %DIR%obj 5 | rmdir /s/q %DIR%libs\armeabi 6 | rmdir /s/q %DIR%assets 7 | 8 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/clean.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 3 | rm -fr $DIR/obj/* 4 | rm -fr $DIR/libs/armeabi/*.so 5 | rm -fr $DIR/assets/* 6 | 7 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/gen/com/zym/moonwarriors/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.zym.moonwarriors; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/gen/com/zym/moonwarriors/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.zym.moonwarriors; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int icon=0x7f020000; 15 | } 16 | public static final class string { 17 | public static final int app_name=0x7f030000; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := game_shared 6 | 7 | LOCAL_MODULE_FILENAME := libgame 8 | 9 | LOCAL_SRC_FILES := hellocpp/main.cpp \ 10 | ../../sources/AppDelegate.cpp 11 | 12 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../sources 13 | 14 | LOCAL_CFLAGS += -D__GXX_EXPERIMENTAL_CXX0X__ -std=gnu++11 -Wno-psabi -DCC_LUA_ENGINE_ENABLED=1 $(ANDROID_COCOS2D_BUILD_FLAGS) 15 | 16 | LOCAL_WHOLE_STATIC_LIBRARIES := quickcocos2dx 17 | 18 | include $(BUILD_SHARED_LIBRARY) 19 | 20 | $(call import-module,lib/proj.android) 21 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | APP_CPPFLAGS := -D__GXX_EXPERIMENTAL_CXX0X__ -std=gnu++11 -frtti -Wno-error=format-security -fsigned-char -Os $(CPPFLAGS) 3 | APP_ABI := armeabi 4 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/jni/hellocpp/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "cocos2d.h" 3 | #include "AppDelegate.h" 4 | #include "platform/android/jni/JniHelper.h" 5 | #include 6 | #include 7 | 8 | #define LOG_TAG "main" 9 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) 10 | 11 | using namespace cocos2d; 12 | 13 | extern "C" 14 | { 15 | 16 | jint JNI_OnLoad(JavaVM *vm, void *reserved) 17 | { 18 | JniHelper::setJavaVM(vm); 19 | return JNI_VERSION_1_4; 20 | } 21 | 22 | void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h) 23 | { 24 | if (!CCDirector::sharedDirector()->getOpenGLView()) 25 | { 26 | CCEGLView *view = CCEGLView::sharedOpenGLView(); 27 | view->setFrameSize(w, h); 28 | 29 | AppDelegate *pAppDelegate = new AppDelegate(); 30 | CCApplication::sharedApplication()->run(); 31 | } 32 | else 33 | { 34 | ccGLInvalidateStateCache(); 35 | CCShaderCache::sharedShaderCache()->reloadDefaultShaders(); 36 | ccDrawInit(); 37 | CCTextureCache::reloadAllTextures(); 38 | CCNotificationCenter::sharedNotificationCenter()->postNotification(EVENT_COME_TO_FOREGROUND, NULL); 39 | CCDirector::sharedDirector()->setGLDefaultValues(); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/jni/list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | append_str=' \' 4 | 5 | list_alldir() 6 | { 7 | for file in $1/* 8 | do 9 | if [ -f $file ]; then 10 | echo $file$append_str | grep .cpp 11 | fi 12 | 13 | if [ -d $file ]; then 14 | list_alldir $file 15 | fi 16 | done 17 | } 18 | 19 | if [ $# -gt 0 ]; then 20 | list_alldir "$1" 21 | else 22 | list_alldir "." 23 | fi 24 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=Google Inc.:Google APIs (x86 System Image):19 15 | android.library=false 16 | android.library.reference.1=../../../lib/cocos2d-x/cocos2dx/platform/android/java 17 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | moonwarriors 4 | 5 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.android/src/com/zym/moonwarriors/Moonwarriors.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2012 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package com.zym.moonwarriors; 25 | 26 | import org.cocos2dx.lib.Cocos2dxActivity; 27 | 28 | import android.os.Bundle; 29 | 30 | public class Moonwarriors extends Cocos2dxActivity { 31 | 32 | @Override 33 | public void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | } 36 | 37 | static { 38 | System.loadLibrary("game"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/AppController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | @class RootViewController; 26 | 27 | #define kOpenGameImmediately 0 28 | #define kOpenGameWaitForAlert 1 29 | #define kOpenGameExit 2 30 | 31 | @interface AppController : NSObject { 32 | UIWindow *window; 33 | @public RootViewController *viewController; 34 | 35 | int openGame; 36 | int appUpdateCheckResult; 37 | } 38 | 39 | @end 40 | 41 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/AppController.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | #import 25 | #import 26 | #import "AppController.h" 27 | #import "cocos2d.h" 28 | #import "EAGLView.h" 29 | #import "AppDelegate.h" 30 | #import "RootViewController.h" 31 | 32 | @implementation AppController 33 | 34 | #pragma mark - 35 | #pragma mark Application lifecycle 36 | 37 | // cocos2d application instance 38 | static AppDelegate s_sharedApplication; 39 | 40 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 41 | // Override point for customization after application launch. 42 | 43 | // Add the view controller's view to the window and display. 44 | window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; 45 | EAGLView *__glView = [EAGLView viewWithFrame: [window bounds] 46 | pixelFormat: kEAGLColorFormatRGBA8 47 | depthFormat: GL_DEPTH24_STENCIL8_OES 48 | preserveBackbuffer: NO 49 | sharegroup: nil 50 | multiSampling: NO 51 | numberOfSamples: 0]; 52 | // Enable multi-touches 53 | // [__glView setMultipleTouchEnabled:YES]; 54 | 55 | // Use RootViewController manage EAGLView 56 | viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; 57 | viewController.wantsFullScreenLayout = YES; 58 | viewController.view = __glView; 59 | 60 | // Set RootViewController to window 61 | if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0) 62 | { 63 | [window addSubview: viewController.view]; 64 | } 65 | [window setRootViewController:viewController]; 66 | [window makeKeyAndVisible]; 67 | [[UIApplication sharedApplication] setStatusBarHidden: YES]; 68 | cocos2d::CCApplication::sharedApplication()->run(); 69 | 70 | return YES; 71 | } 72 | 73 | - (void)applicationWillResignActive:(UIApplication *)application { 74 | /* 75 | 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. 76 | 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. 77 | */ 78 | cocos2d::CCDirector::sharedDirector()->pause(); 79 | } 80 | 81 | - (void)applicationDidBecomeActive:(UIApplication *)application { 82 | /* 83 | 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. 84 | */ 85 | cocos2d::CCDirector::sharedDirector()->resume(); 86 | } 87 | 88 | - (void)applicationDidEnterBackground:(UIApplication *)application { 89 | /* 90 | 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. 91 | If your application supports background execution, called instead of applicationWillTerminate: when the user quits. 92 | */ 93 | cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground(); 94 | } 95 | 96 | - (void)applicationWillEnterForeground:(UIApplication *)application { 97 | /* 98 | 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. 99 | */ 100 | NSError *err; 101 | [[AVAudioSession sharedInstance] setActive:true error:&err]; 102 | cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground(); 103 | } 104 | 105 | - (void)applicationWillTerminate:(UIApplication *)application { 106 | /* 107 | Called when the application is about to terminate. 108 | See also applicationDidEnterBackground:. 109 | */ 110 | } 111 | 112 | #pragma mark - 113 | #pragma mark Memory management 114 | 115 | - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 116 | /* 117 | Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. 118 | */ 119 | } 120 | 121 | - (void)dealloc { 122 | [super dealloc]; 123 | } 124 | 125 | @end 126 | 127 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.ios/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.ios/Resources/Default.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.ios/Resources/Default@2x.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/Resources/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.ios/Resources/Icon-72.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.ios/Resources/Icon.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/Resources/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.ios/Resources/Icon@2x.png -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDisplayName 6 | ${PRODUCT_NAME} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIconFiles 12 | 13 | Icon.png 14 | Icon@2x.png 15 | Icon-72.png 16 | 17 | CFBundleIdentifier 18 | com.zym.${PRODUCT_NAME:rfc1034identifier} 19 | CFBundleInfoDictionaryVersion 20 | 6.0 21 | CFBundleName 22 | ${PRODUCT_NAME} 23 | CFBundlePackageType 24 | APPL 25 | CFBundleShortVersionString 26 | 1.0 27 | CFBundleSignature 28 | ???? 29 | CFBundleVersion 30 | 1.0 31 | LSRequiresIPhoneOS 32 | 33 | UIPrerenderedIcon 34 | 35 | UIRequiredDeviceCapabilities 36 | 37 | accelerometer 38 | 39 | opengles-1 40 | 41 | 42 | UIStatusBarHidden 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/RootViewController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | Copyright (c) 2010 Ricardo Quesada 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | #import 27 | #import 28 | 29 | @interface RootViewController : UIViewController 30 | 31 | - (BOOL) prefersStatusBarHidden; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/RootViewController.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | Copyright (c) 2010 Ricardo Quesada 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | #import "RootViewController.h" 27 | 28 | 29 | @implementation RootViewController 30 | 31 | // GKLeaderboardViewControllerのDelegate 32 | -(void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController 33 | { 34 | [self dismissViewControllerAnimated:YES completion:nil]; 35 | } 36 | 37 | // GKAchievementViewControllerのDelegate 38 | -(void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController 39 | { 40 | [self dismissViewControllerAnimated:YES completion:nil]; 41 | } 42 | 43 | // Override to allow orientations other than the default portrait orientation. 44 | // This method is deprecated on ios6 45 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 46 | return UIInterfaceOrientationIsPortrait(interfaceOrientation); 47 | } 48 | 49 | // For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead 50 | - (NSUInteger) supportedInterfaceOrientations 51 | { 52 | #ifdef __IPHONE_6_0 53 | return UIInterfaceOrientationMaskPortrait; 54 | #endif 55 | } 56 | 57 | - (BOOL) shouldAutorotate { 58 | return YES; 59 | } 60 | 61 | //fix not hide status on ios7 62 | - (BOOL) prefersStatusBarHidden { 63 | return YES; 64 | } 65 | 66 | - (void)didReceiveMemoryWarning { 67 | // Releases the view if it doesn't have a superview. 68 | [super didReceiveMemoryWarning]; 69 | // Release any cached data, images, etc that aren't in use. 70 | } 71 | 72 | - (void)viewDidUnload { 73 | [super viewDidUnload]; 74 | // Release any retained subviews of the main view. 75 | // e.g. self.myOutlet = nil; 76 | } 77 | 78 | - (void)dealloc { 79 | [super dealloc]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.ios/main.m: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | int main(int argc, char *argv[]) { 5 | NSAutoreleasePool *pool = [NSAutoreleasePool new]; 6 | int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); 7 | [pool release]; 8 | return retVal; 9 | } 10 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.mac/AppController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #import "EAGLView.h" 26 | 27 | #include 28 | #include "ProjectConfig/SimulatorConfig.h" 29 | #include "AppDelegate.h" 30 | 31 | @interface AppController : NSObject 32 | { 33 | NSWindow *window; 34 | EAGLView *glView; 35 | NSMenu *menu; 36 | 37 | BOOL isAlwaysOnTop; 38 | 39 | AppDelegate *app; 40 | ProjectConfig projectConfig; 41 | } 42 | 43 | @property (nonatomic, assign) IBOutlet NSMenu* menu; 44 | 45 | - (IBAction) onFileRelaunch:(id)sender; 46 | 47 | - (IBAction) onScreenPortait:(id)sender; 48 | - (IBAction) onScreenLandscape:(id)sender; 49 | - (IBAction) onScreenZoomOut:(id)sender; 50 | 51 | - (IBAction) onWindowAlwaysOnTop:(id)sender; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.mac/AppController.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #import "AppController.h" 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include "AppDelegate.h" 34 | #include "CCDirector.h" 35 | #include "SimpleAudioEngine.h" 36 | #include "platform/CCFileUtils.h" 37 | #include "native/CCNative.h" 38 | 39 | using namespace std; 40 | using namespace cocos2d; 41 | using namespace cocos2d::extra; 42 | 43 | @implementation AppController 44 | 45 | @synthesize menu; 46 | 47 | -(void) dealloc 48 | { 49 | CCDirector::sharedDirector()->end(); 50 | [super dealloc]; 51 | } 52 | 53 | #pragma mark - 54 | #pragma delegates 55 | 56 | - (void) applicationDidFinishLaunching:(NSNotification *)aNotification 57 | { 58 | isAlwaysOnTop = NO; 59 | 60 | [self updateProjectConfigFromCommandLineArgs:&projectConfig]; 61 | [self createWindowAndGLView]; 62 | [self startup]; 63 | [self initUI]; 64 | [self updateUI]; 65 | 66 | [window orderFrontRegardless]; 67 | [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; 68 | } 69 | 70 | - (BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication 71 | { 72 | return YES; 73 | } 74 | 75 | - (BOOL) applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag 76 | { 77 | return NO; 78 | } 79 | 80 | - (void) windowWillClose:(NSNotification *)notification 81 | { 82 | CCDirector::sharedDirector()->end(); 83 | [[NSApplication sharedApplication] terminate:self]; 84 | } 85 | 86 | #pragma mark - 87 | #pragma mark functions 88 | 89 | - (void) createWindowAndGLView 90 | { 91 | const CCSize frameSize = projectConfig.getFrameSize(); 92 | float left = 10; 93 | float bottom = NSHeight([[NSScreen mainScreen] visibleFrame]) - frameSize.height; 94 | bottom -= [[[NSApplication sharedApplication] menu] menuBarHeight] + 10; 95 | 96 | NSDictionary *state = [[NSUserDefaults standardUserDefaults] objectForKey:@"last-state"]; 97 | if (state) 98 | { 99 | NSNumber *x = [state objectForKey:@"x"]; 100 | NSNumber *y = [state objectForKey:@"y"]; 101 | if (x && y) 102 | { 103 | projectConfig.setWindowOffset(CCPoint([x floatValue], [y floatValue])); 104 | } 105 | NSNumber *scale = [state objectForKey:@"scale"]; 106 | if (scale) 107 | { 108 | projectConfig.setFrameScale([scale floatValue]); 109 | } 110 | } 111 | 112 | // create the window 113 | // note that using NSResizableWindowMask causes the window to be a little 114 | // smaller and therefore ipad graphics are not loaded 115 | NSRect rect = NSMakeRect(left, bottom, frameSize.width, frameSize.height); 116 | NSInteger mask = NSClosableWindowMask | NSTitledWindowMask | NSMiniaturizableWindowMask; 117 | window = [[NSWindow alloc] initWithContentRect:rect 118 | styleMask:mask 119 | backing:NSBackingStoreBuffered 120 | defer:YES]; 121 | window.delegate = self; 122 | 123 | // allocate our GL view 124 | // (isn't there already a shared EAGLView?) 125 | glView = [[EAGLView alloc] initWithFrame:rect]; 126 | 127 | // set window parameters 128 | [window setContentView:glView]; 129 | [window setTitle:@"moonwarriors"]; 130 | [window center]; 131 | 132 | if (projectConfig.getProjectDir().length()) 133 | { 134 | [self setZoom:projectConfig.getFrameScale()]; 135 | CCPoint pos = projectConfig.getWindowOffset(); 136 | if (pos.x != 0 && pos.y != 0) 137 | { 138 | [window setFrameOrigin:NSMakePoint(pos.x, pos.y)]; 139 | } 140 | } 141 | 142 | [window becomeFirstResponder]; 143 | [window makeKeyAndOrderFront:self]; 144 | [window setAcceptsMouseMovedEvents:NO]; 145 | } 146 | 147 | - (void) startup 148 | { 149 | const string projectDir = projectConfig.getProjectDir(); 150 | if (projectDir.length()) 151 | { 152 | CCFileUtils::sharedFileUtils()->setSearchRootPath(projectDir.c_str()); 153 | } 154 | 155 | const string writablePath = projectConfig.getWritableRealPath(); 156 | if (writablePath.length()) 157 | { 158 | CCFileUtils::sharedFileUtils()->setWritablePath(writablePath.c_str()); 159 | } 160 | 161 | app = new AppDelegate(); 162 | app->setProjectConfig(projectConfig); 163 | app->run(); 164 | } 165 | 166 | - (void) initUI 167 | { 168 | NSMenu *submenu = [[[window menu] itemWithTitle:@"Screen"] submenu]; 169 | 170 | SimulatorConfig *config = SimulatorConfig::sharedDefaults(); 171 | int current = config->checkScreenSize(projectConfig.getFrameSize()); 172 | for (int i = config->getScreenSizeCount() - 1; i >= 0; --i) 173 | { 174 | SimulatorScreenSize size = config->getScreenSize(i); 175 | NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithCString:size.title.c_str() encoding:NSUTF8StringEncoding] 176 | action:@selector(onScreenChangeFrameSize:) 177 | keyEquivalent:@""] autorelease]; 178 | [item setTag:i]; 179 | 180 | if (i == current) 181 | { 182 | [item setState:NSOnState]; 183 | } 184 | [submenu insertItem:item atIndex:0]; 185 | } 186 | } 187 | 188 | - (void) updateUI 189 | { 190 | NSMenu *menuScreen = [[[window menu] itemWithTitle:@"Screen"] submenu]; 191 | NSMenuItem *itemPortait = [menuScreen itemWithTitle:@"Portait"]; 192 | NSMenuItem *itemLandscape = [menuScreen itemWithTitle:@"Landscape"]; 193 | if (projectConfig.isLandscapeFrame()) 194 | { 195 | [itemPortait setState:NSOffState]; 196 | [itemLandscape setState:NSOnState]; 197 | } 198 | else 199 | { 200 | [itemPortait setState:NSOnState]; 201 | [itemLandscape setState:NSOffState]; 202 | } 203 | 204 | int scale = projectConfig.getFrameScale() * 100; 205 | 206 | NSMenuItem *itemZoom100 = [menuScreen itemWithTitle:@"Actual (100%)"]; 207 | NSMenuItem *itemZoom75 = [menuScreen itemWithTitle:@"Zoom Out (75%)"]; 208 | NSMenuItem *itemZoom50 = [menuScreen itemWithTitle:@"Zoom Out (50%)"]; 209 | NSMenuItem *itemZoom25 = [menuScreen itemWithTitle:@"Zoom Out (25%)"]; 210 | [itemZoom100 setState:NSOffState]; 211 | [itemZoom75 setState:NSOffState]; 212 | [itemZoom50 setState:NSOffState]; 213 | [itemZoom25 setState:NSOffState]; 214 | if (scale == 100) 215 | { 216 | [itemZoom100 setState:NSOnState]; 217 | } 218 | else if (scale == 75) 219 | { 220 | [itemZoom75 setState:NSOnState]; 221 | } 222 | else if (scale == 50) 223 | { 224 | [itemZoom50 setState:NSOnState]; 225 | } 226 | else if (scale == 25) 227 | { 228 | [itemZoom25 setState:NSOnState]; 229 | } 230 | 231 | [window setTitle:[NSString stringWithFormat:@"moonwarriors (%0.0f%%)", projectConfig.getFrameScale() * 100]]; 232 | } 233 | 234 | - (NSMutableArray*) makeCommandLineArgsFromProjectConfig 235 | { 236 | return [self makeCommandLineArgsFromProjectConfig:kProjectConfigAll]; 237 | } 238 | 239 | - (NSMutableArray*) makeCommandLineArgsFromProjectConfig:(unsigned int)mask 240 | { 241 | projectConfig.setWindowOffset(CCPoint(window.frame.origin.x, window.frame.origin.y)); 242 | NSString *commandLine = [NSString stringWithCString:projectConfig.makeCommandLine(mask).c_str() 243 | encoding:NSUTF8StringEncoding]; 244 | return [NSMutableArray arrayWithArray:[commandLine componentsSeparatedByString:@" "]]; 245 | } 246 | 247 | - (void) updateProjectConfigFromCommandLineArgs:(ProjectConfig *)config 248 | { 249 | NSArray *nsargs = [[NSProcessInfo processInfo] arguments]; 250 | vector args; 251 | for (int i = 0; i < [nsargs count]; ++i) 252 | { 253 | args.push_back([[nsargs objectAtIndex:i] cStringUsingEncoding:NSUTF8StringEncoding]); 254 | } 255 | config->parseCommandLine(args); 256 | config->dump(); 257 | } 258 | 259 | - (void) launch:(NSArray*)args 260 | { 261 | NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]; 262 | NSMutableDictionary *configuration = [NSMutableDictionary dictionaryWithObject:args 263 | forKey:NSWorkspaceLaunchConfigurationArguments]; 264 | NSError *error = [[[NSError alloc] init] autorelease]; 265 | [[NSWorkspace sharedWorkspace] launchApplicationAtURL:url 266 | options:NSWorkspaceLaunchNewInstance 267 | configuration:configuration error:&error]; 268 | } 269 | 270 | - (void) relaunch:(NSArray*)args 271 | { 272 | [self saveLastState]; 273 | if (projectConfig.isExitWhenRelaunch()) 274 | { 275 | exit(99); 276 | } 277 | else 278 | { 279 | [self launch:args]; 280 | [[NSApplication sharedApplication] terminate:self]; 281 | } 282 | } 283 | 284 | - (void) relaunch 285 | { 286 | [self relaunch:[self makeCommandLineArgsFromProjectConfig]]; 287 | } 288 | 289 | - (void) showAlertWithoutSheet:(NSString*)message withTitle:(NSString*)title 290 | { 291 | NSAlert *alert = [[[NSAlert alloc] init] autorelease]; 292 | [alert addButtonWithTitle:@"OK"]; 293 | [alert setMessageText:message]; 294 | [alert setInformativeText:title]; 295 | [alert setAlertStyle:NSWarningAlertStyle]; 296 | [alert runModal]; 297 | } 298 | 299 | - (void) setZoom:(float)scale 300 | { 301 | [glView setFrameZoomFactor:scale]; 302 | projectConfig.setFrameScale(scale); 303 | } 304 | 305 | -(void) setAlwaysOnTop:(BOOL)alwaysOnTop 306 | { 307 | NSMenuItem *windowMenu = [[window menu] itemWithTitle:@"Window"]; 308 | NSMenuItem *menuItem = [[windowMenu submenu] itemWithTitle:@"Always On Top"]; 309 | if (alwaysOnTop) 310 | { 311 | [window setLevel:NSFloatingWindowLevel]; 312 | [menuItem setState:NSOnState]; 313 | } 314 | else 315 | { 316 | [window setLevel:NSNormalWindowLevel]; 317 | [menuItem setState:NSOffState]; 318 | } 319 | isAlwaysOnTop = alwaysOnTop; 320 | } 321 | 322 | -(void) saveLastState 323 | { 324 | NSMutableDictionary *state = [NSMutableDictionary dictionary]; 325 | [state setObject:[NSNumber numberWithInt:window.frame.origin.x] forKey:@"x"]; 326 | [state setObject:[NSNumber numberWithInt:window.frame.origin.y] forKey:@"y"]; 327 | [state setObject:[NSNumber numberWithFloat:projectConfig.getFrameScale()] forKey:@"scale"]; 328 | [[NSUserDefaults standardUserDefaults] setObject:state forKey:@"last-state"]; 329 | [[NSUserDefaults standardUserDefaults] synchronize]; 330 | } 331 | 332 | #pragma mark - 333 | #pragma mark IB Actions 334 | 335 | - (IBAction) onFileRelaunch:(id)sender 336 | { 337 | [self relaunch]; 338 | } 339 | 340 | - (IBAction) onScreenChangeFrameSize:(id)sender 341 | { 342 | NSInteger i = [sender tag]; 343 | if (i >= 0 && i < SimulatorConfig::sharedDefaults()->getScreenSizeCount()) 344 | { 345 | SimulatorScreenSize size = SimulatorConfig::sharedDefaults()->getScreenSize((int)i); 346 | projectConfig.setFrameSize(projectConfig.isLandscapeFrame() ? CCSize(size.height, size.width) : CCSize(size.width, size.height)); 347 | projectConfig.setFrameScale(1.0f); 348 | [self relaunch]; 349 | } 350 | } 351 | 352 | - (IBAction) onScreenPortait:(id)sender 353 | { 354 | if ([sender state] == NSOnState) return; 355 | [sender setState:NSOnState]; 356 | [[[[[window menu] itemWithTitle:@"Screen"] submenu] itemWithTitle:@"Landscape"] setState:NSOffState]; 357 | projectConfig.changeFrameOrientationToPortait(); 358 | [self relaunch]; 359 | } 360 | 361 | - (IBAction) onScreenLandscape:(id)sender 362 | { 363 | if ([sender state] == NSOnState) return; 364 | [sender setState:NSOnState]; 365 | [[[[[window menu] itemWithTitle:@"Screen"] submenu] itemWithTitle:@"Portait"] setState:NSOffState]; 366 | projectConfig.changeFrameOrientationToLandscape(); 367 | [self relaunch]; 368 | } 369 | 370 | - (IBAction) onScreenZoomOut:(id)sender 371 | { 372 | if ([sender state] == NSOnState) return; 373 | float scale = (float)[sender tag] / 100.0f; 374 | [self setZoom:scale]; 375 | [self updateUI]; 376 | } 377 | 378 | -(IBAction) onWindowAlwaysOnTop:(id)sender 379 | { 380 | [self setAlwaysOnTop:!isAlwaysOnTop]; 381 | } 382 | 383 | @end 384 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.mac/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.mac/Icon.icns -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Icon 11 | CFBundleIdentifier 12 | com.qeeplay.apps.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 20131001 25 | LSApplicationCategoryType 26 | public.app-category.developer-tools 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHumanReadableCopyright 30 | Copyright © 2012 qeeplay.com. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.mac/main.m: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | return NSApplicationMain(argc, (const char **)argv); 7 | } 8 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/app.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "resource.h" 5 | 6 | // C RunTime Header Files 7 | #include "CCStdC.h" 8 | 9 | #include 10 | 11 | #include "cocos2d.h" 12 | #include "AppDelegate.h" 13 | #include "ProjectConfig/SimulatorConfig.h" 14 | 15 | using namespace std; 16 | using namespace cocos2d; 17 | 18 | class CC_DLL App : public CCObject 19 | { 20 | public: 21 | static int createAndRun(void); 22 | 23 | AppDelegate *getApp(void) { 24 | return m_app; 25 | } 26 | 27 | HWND getWindowHandle(void) { 28 | return m_hwnd; 29 | } 30 | 31 | private: 32 | static App *s_sharedInstance; 33 | static App *sharedInstance(void); 34 | static void purgeSharedInstance(void); 35 | 36 | App(void); 37 | 38 | AppDelegate *m_app; 39 | ProjectConfig m_project; 40 | 41 | HWND m_hwnd; 42 | BOOL m_exit; 43 | FILE *m_writeDebugLogFile; 44 | 45 | int run(void); 46 | void loadProjectConfig(void); 47 | void createViewMenu(void); 48 | void updateMenu(void); 49 | void relaunch(void); 50 | 51 | // debug log 52 | void writeDebugLog(const char *log); 53 | 54 | // menu callback 55 | void onFileRelaunch(void); 56 | void onFileExit(void); 57 | 58 | void onViewChangeFrameSize(int viewMenuID); 59 | void onViewChangeOrientation(int viewMenuID); 60 | void onViewChangeZoom(int scaleMode); 61 | 62 | // windows callback 63 | static LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam, BOOL *pProcessed); 64 | }; 65 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.win32/app.ico -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/app.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.win32/app.rc -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/debug.log: -------------------------------------------------------------------------------- 1 | 2 | 3 | cocos2d.x.version: quick-cocos2d-x 2.2.5plus 4 | cocos2d.x.compiled_with_profiler: false 5 | cocos2d.x.compiled_with_gl_state_cache: true 6 | gl.vendor: Intel 7 | gl.renderer: Intel(R) HD Graphics 4000 8 | gl.version: 3.3.0 - Build 8.15.10.2778 9 | gl.max_texture_size: 8192 10 | gl.max_texture_units: 16 11 | gl.supports_PVRTC: false 12 | gl.supports_NPOT: true 13 | gl.supports_BGRA8888: false 14 | gl.supports_discard_framebuffer: false 15 | gl.supports_vertex_array_object: true 16 | 17 | lua_loadChunksFromZIP() - load zip file: E:\Demo\cocos2d-x\quick-cocos2d-x-2.2.5\lib\framework_precompiled\framework_precompiled.zip 18 | lua_loadChunksFromZIP() - loaded chunks count: 122 19 | ------------------------------------------------ 20 | LOAD LUA FILE: scripts/main.lua 21 | ------------------------------------------------ 22 | Get data from file(scripts/main.lua) failed! 23 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/moonwarriors.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "moonwarriors", "moonwarriors.vcxproj", "{71666DE3-D772-41E9-8624-8881686C7AED}" 5 | ProjectSection(ProjectDependencies) = postProject 6 | {9E05AA4B-1A09-433C-B1DF-BCE6675EC0D5} = {9E05AA4B-1A09-433C-B1DF-BCE6675EC0D5} 7 | EndProjectSection 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cocos2dx_2012", "%QUICK_COCOS2DX_ROOT%\lib\proj.win32\cocos2dx_2012.vcxproj", "{9E05AA4B-1A09-433C-B1DF-BCE6675EC0D5}" 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {71666DE3-D772-41E9-8624-8881686C7AED}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {71666DE3-D772-41E9-8624-8881686C7AED}.Debug|Win32.Build.0 = Debug|Win32 19 | {71666DE3-D772-41E9-8624-8881686C7AED}.Release|Win32.ActiveCfg = Release|Win32 20 | {71666DE3-D772-41E9-8624-8881686C7AED}.Release|Win32.Build.0 = Release|Win32 21 | {9E05AA4B-1A09-433C-B1DF-BCE6675EC0D5}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {9E05AA4B-1A09-433C-B1DF-BCE6675EC0D5}.Debug|Win32.Build.0 = Debug|Win32 23 | {9E05AA4B-1A09-433C-B1DF-BCE6675EC0D5}.Release|Win32.ActiveCfg = Release|Win32 24 | {9E05AA4B-1A09-433C-B1DF-BCE6675EC0D5}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/moonwarriors.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.win32/moonwarriors.v11.suo -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/moonwarriors.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {da35f943-2f62-4dbf-bd58-91a522b39592} 6 | 7 | 8 | {54d36d2c-b373-4c65-962b-76ff1fedc28b} 9 | 10 | 11 | 12 | 13 | win32 14 | 15 | 16 | sources 17 | 18 | 19 | win32 20 | 21 | 22 | 23 | 24 | win32 25 | 26 | 27 | win32 28 | 29 | 30 | win32 31 | 32 | 33 | sources 34 | 35 | 36 | win32 37 | 38 | 39 | 40 | 41 | win32 42 | 43 | 44 | 45 | 46 | win32 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/moonwarriors.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/proj.win32/resource.h -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/stdafx.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/stdafx.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 5 | 6 | // Windows Header Files 7 | #include 8 | 9 | // C RunTime Header Files 10 | #include 11 | #include 12 | #include 13 | #include 14 | -------------------------------------------------------------------------------- /源代码/moonwarriors/proj.win32/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/arial-14.fnt: -------------------------------------------------------------------------------- 1 | info face="ArialMT" size=14 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 2 | common lineHeight=15 base=13 scaleW=256 scaleH=128 pages=1 packed=0 3 | page id=0 file="arial-14.png" 4 | chars count=95 5 | char id=64 x=2 y=2 width=18 height=18 xoffset=-1 yoffset=1 xadvance=14 page=0 chnl=0 letter="@" 6 | char id=123 x=22 y=2 width=9 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="{" 7 | char id=125 x=33 y=2 width=9 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="}" 8 | char id=40 x=44 y=2 width=8 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="(" 9 | char id=41 x=54 y=2 width=8 height=18 xoffset=0 yoffset=1 xadvance=5 page=0 chnl=0 letter=")" 10 | char id=124 x=64 y=2 width=6 height=18 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=0 letter="|" 11 | char id=36 x=72 y=2 width=12 height=17 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="$" 12 | char id=106 x=86 y=2 width=8 height=17 xoffset=-2 yoffset=2 xadvance=3 page=0 chnl=0 letter="j" 13 | char id=91 x=96 y=2 width=8 height=17 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="[" 14 | char id=93 x=106 y=2 width=7 height=17 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="]" 15 | char id=37 x=115 y=2 width=16 height=16 xoffset=-1 yoffset=1 xadvance=12 page=0 chnl=0 letter="%" 16 | char id=81 x=133 y=2 width=15 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="Q" 17 | char id=79 x=150 y=2 width=15 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="O" 18 | char id=71 x=167 y=2 width=14 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="G" 19 | char id=67 x=183 y=2 width=14 height=16 xoffset=-1 yoffset=1 xadvance=10 page=0 chnl=0 letter="C" 20 | char id=38 x=199 y=2 width=13 height=16 xoffset=-1 yoffset=1 xadvance=9 page=0 chnl=0 letter="&" 21 | char id=83 x=214 y=2 width=13 height=16 xoffset=-1 yoffset=1 xadvance=9 page=0 chnl=0 letter="S" 22 | char id=35 x=229 y=2 width=12 height=16 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="#" 23 | char id=47 x=243 y=2 width=8 height=16 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="/" 24 | char id=92 x=2 y=22 width=8 height=16 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="\" 25 | char id=85 x=12 y=22 width=12 height=15 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="U" 26 | char id=51 x=26 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="3" 27 | char id=53 x=40 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="5" 28 | char id=54 x=54 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="6" 29 | char id=56 x=68 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="8" 30 | char id=57 x=82 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="9" 31 | char id=48 x=96 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="0" 32 | char id=63 x=110 y=22 width=12 height=15 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="?" 33 | char id=98 x=124 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="b" 34 | char id=112 x=138 y=22 width=12 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="p" 35 | char id=121 x=152 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="y" 36 | char id=103 x=165 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="g" 37 | char id=100 x=178 y=22 width=11 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="d" 38 | char id=113 x=191 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="q" 39 | char id=74 x=204 y=22 width=10 height=15 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 letter="J" 40 | char id=102 x=216 y=22 width=9 height=15 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="f" 41 | char id=116 x=227 y=22 width=8 height=15 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="t" 42 | char id=87 x=237 y=22 width=17 height=14 xoffset=-1 yoffset=2 xadvance=13 page=0 chnl=0 letter="W" 43 | char id=77 x=2 y=40 width=14 height=14 xoffset=0 yoffset=2 xadvance=12 page=0 chnl=0 letter="M" 44 | char id=65 x=18 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="A" 45 | char id=86 x=34 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="V" 46 | char id=88 x=50 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="X" 47 | char id=89 x=66 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="Y" 48 | char id=82 x=82 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="R" 49 | char id=68 x=97 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="D" 50 | char id=75 x=112 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="K" 51 | char id=84 x=127 y=40 width=13 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="T" 52 | char id=90 x=142 y=40 width=13 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="Z" 53 | char id=72 x=157 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="H" 54 | char id=78 x=171 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="N" 55 | char id=66 x=185 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="B" 56 | char id=80 x=199 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="P" 57 | char id=69 x=213 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="E" 58 | char id=52 x=227 y=40 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="4" 59 | char id=50 x=241 y=40 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="2" 60 | char id=55 x=2 y=56 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="7" 61 | char id=70 x=16 y=56 width=11 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="F" 62 | char id=76 x=29 y=56 width=11 height=14 xoffset=0 yoffset=2 xadvance=8 page=0 chnl=0 letter="L" 63 | char id=104 x=42 y=56 width=11 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="h" 64 | char id=107 x=55 y=56 width=11 height=14 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 letter="k" 65 | char id=49 x=68 y=56 width=9 height=14 xoffset=0 yoffset=2 xadvance=8 page=0 chnl=0 letter="1" 66 | char id=105 x=79 y=56 width=7 height=14 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="i" 67 | char id=108 x=88 y=56 width=7 height=14 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="l" 68 | char id=73 x=97 y=56 width=6 height=14 xoffset=0 yoffset=2 xadvance=4 page=0 chnl=0 letter="I" 69 | char id=33 x=105 y=56 width=6 height=14 xoffset=0 yoffset=2 xadvance=4 page=0 chnl=0 letter="!" 70 | char id=59 x=113 y=56 width=6 height=14 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter=";" 71 | char id=111 x=121 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="o" 72 | char id=97 x=135 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="a" 73 | char id=101 x=149 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="e" 74 | char id=99 x=163 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="c" 75 | char id=115 x=176 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="s" 76 | char id=117 x=189 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="u" 77 | char id=109 x=202 y=56 width=15 height=12 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 letter="m" 78 | char id=119 x=219 y=56 width=14 height=12 xoffset=-1 yoffset=4 xadvance=10 page=0 chnl=0 letter="w" 79 | char id=60 x=235 y=56 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter="<" 80 | char id=62 x=2 y=72 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter=">" 81 | char id=43 x=16 y=72 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter="+" 82 | char id=118 x=30 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="v" 83 | char id=120 x=43 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="x" 84 | char id=122 x=56 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="z" 85 | char id=110 x=69 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="n" 86 | char id=114 x=82 y=72 width=9 height=12 xoffset=-1 yoffset=4 xadvance=5 page=0 chnl=0 letter="r" 87 | char id=58 x=93 y=72 width=6 height=12 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter=":" 88 | char id=94 x=101 y=72 width=11 height=11 xoffset=-1 yoffset=1 xadvance=7 page=0 chnl=0 letter="^" 89 | char id=61 x=114 y=72 width=12 height=10 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="=" 90 | char id=42 x=128 y=72 width=9 height=9 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="*" 91 | char id=34 x=139 y=72 width=9 height=8 xoffset=-1 yoffset=2 xadvance=5 page=0 chnl=0 letter=""" 92 | char id=39 x=150 y=72 width=6 height=8 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="'" 93 | char id=44 x=158 y=72 width=6 height=8 xoffset=0 yoffset=10 xadvance=4 page=0 chnl=0 letter="," 94 | char id=126 x=166 y=72 width=12 height=7 xoffset=-1 yoffset=6 xadvance=8 page=0 chnl=0 letter="~" 95 | char id=96 x=180 y=72 width=8 height=7 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="`" 96 | char id=95 x=190 y=72 width=13 height=6 xoffset=-2 yoffset=13 xadvance=8 page=0 chnl=0 letter="_" 97 | char id=45 x=205 y=72 width=9 height=6 xoffset=-1 yoffset=7 xadvance=5 page=0 chnl=0 letter="-" 98 | char id=46 x=216 y=72 width=6 height=6 xoffset=0 yoffset=10 xadvance=4 page=0 chnl=0 letter="." 99 | char id=32 x=224 y=72 width=0 height=0 xoffset=0 yoffset=133 xadvance=4 page=0 chnl=0 letter="space" 100 | kernings count=82 101 | kerning first=64 second=42 amount=-1 102 | kerning first=79 second=102 amount=-1 103 | kerning first=79 second=82 amount=-1 104 | kerning first=47 second=52 amount=-1 105 | kerning first=63 second=126 amount=-1 106 | kerning first=121 second=44 amount=-1 107 | kerning first=121 second=46 amount=-1 108 | kerning first=87 second=65 amount=-1 109 | kerning first=87 second=97 amount=-1 110 | kerning first=87 second=44 amount=-1 111 | kerning first=87 second=46 amount=-1 112 | kerning first=65 second=87 amount=-1 113 | kerning first=65 second=86 amount=-1 114 | kerning first=65 second=89 amount=-1 115 | kerning first=65 second=84 amount=-1 116 | kerning first=65 second=32 amount=-1 117 | kerning first=86 second=121 amount=-1 118 | kerning first=86 second=65 amount=-1 119 | kerning first=86 second=59 amount=-1 120 | kerning first=86 second=111 amount=-1 121 | kerning first=86 second=97 amount=-1 122 | kerning first=86 second=101 amount=-1 123 | kerning first=86 second=117 amount=-1 124 | kerning first=86 second=114 amount=-1 125 | kerning first=86 second=58 amount=-1 126 | kerning first=86 second=44 amount=-1 127 | kerning first=86 second=45 amount=-1 128 | kerning first=86 second=46 amount=-1 129 | kerning first=89 second=112 amount=-1 130 | kerning first=89 second=113 amount=-1 131 | kerning first=89 second=65 amount=-1 132 | kerning first=89 second=105 amount=-1 133 | kerning first=89 second=59 amount=-1 134 | kerning first=89 second=111 amount=-1 135 | kerning first=89 second=97 amount=-1 136 | kerning first=89 second=101 amount=-1 137 | kerning first=89 second=117 amount=-1 138 | kerning first=89 second=118 amount=-1 139 | kerning first=89 second=58 amount=-1 140 | kerning first=89 second=44 amount=-2 141 | kerning first=89 second=45 amount=-1 142 | kerning first=89 second=46 amount=-2 143 | kerning first=84 second=121 amount=-1 144 | kerning first=84 second=65 amount=-1 145 | kerning first=84 second=105 amount=-1 146 | kerning first=84 second=59 amount=-2 147 | kerning first=84 second=111 amount=-2 148 | kerning first=84 second=97 amount=-2 149 | kerning first=84 second=101 amount=-2 150 | kerning first=84 second=99 amount=-2 151 | kerning first=84 second=115 amount=-2 152 | kerning first=84 second=117 amount=-1 153 | kerning first=84 second=119 amount=-1 154 | kerning first=84 second=114 amount=-1 155 | kerning first=84 second=58 amount=-2 156 | kerning first=84 second=44 amount=-2 157 | kerning first=84 second=45 amount=-1 158 | kerning first=84 second=46 amount=-2 159 | kerning first=80 second=65 amount=-1 160 | kerning first=80 second=62 amount=-1 161 | kerning first=80 second=44 amount=-2 162 | kerning first=80 second=46 amount=-2 163 | kerning first=70 second=65 amount=-1 164 | kerning first=70 second=44 amount=-2 165 | kerning first=70 second=46 amount=-2 166 | kerning first=76 second=121 amount=-1 167 | kerning first=76 second=87 amount=-1 168 | kerning first=76 second=86 amount=-1 169 | kerning first=76 second=89 amount=-1 170 | kerning first=76 second=84 amount=-1 171 | kerning first=76 second=32 amount=-1 172 | kerning first=49 second=49 amount=-1 173 | kerning first=33 second=102 amount=-1 174 | kerning first=119 second=44 amount=-1 175 | kerning first=119 second=46 amount=-1 176 | kerning first=62 second=35 amount=-1 177 | kerning first=118 second=44 amount=-1 178 | kerning first=118 second=46 amount=-1 179 | kerning first=114 second=44 amount=-1 180 | kerning first=114 second=46 amount=-1 181 | kerning first=32 second=92 amount=-1 182 | kerning first=32 second=65 amount=-1 183 | -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/arial-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/arial-14.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/b01.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/b01.plist -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/b01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/b01.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/cocos2d-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/cocos2d-html5.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/explode.plist: -------------------------------------------------------------------------------- 1 | XXTEA -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/explosion.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/explosion.plist -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/explosion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/explosion.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/flare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/flare.jpg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/gameOver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/gameOver.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/level01.tmx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/level01.tmx -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/loading.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/logo.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/menu.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/menuTitle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/menuTitle.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/textureOpaquePack.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/textureOpaquePack.plist -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/textureOpaquePack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/textureOpaquePack.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/textureTransparentPack.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/textureTransparentPack.plist -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Image/textureTransparentPack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Image/textureTransparentPack.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/arial-14.GlyphProject: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/arial-14.GlyphProject -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/arial-14.fnt: -------------------------------------------------------------------------------- 1 | info face="ArialMT" size=14 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 2 | common lineHeight=15 base=13 scaleW=256 scaleH=128 pages=1 packed=0 3 | page id=0 file="arial-14.png" 4 | chars count=95 5 | char id=64 x=2 y=2 width=18 height=18 xoffset=-1 yoffset=1 xadvance=14 page=0 chnl=0 letter="@" 6 | char id=123 x=22 y=2 width=9 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="{" 7 | char id=125 x=33 y=2 width=9 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="}" 8 | char id=40 x=44 y=2 width=8 height=18 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="(" 9 | char id=41 x=54 y=2 width=8 height=18 xoffset=0 yoffset=1 xadvance=5 page=0 chnl=0 letter=")" 10 | char id=124 x=64 y=2 width=6 height=18 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=0 letter="|" 11 | char id=36 x=72 y=2 width=12 height=17 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="$" 12 | char id=106 x=86 y=2 width=8 height=17 xoffset=-2 yoffset=2 xadvance=3 page=0 chnl=0 letter="j" 13 | char id=91 x=96 y=2 width=8 height=17 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="[" 14 | char id=93 x=106 y=2 width=7 height=17 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="]" 15 | char id=37 x=115 y=2 width=16 height=16 xoffset=-1 yoffset=1 xadvance=12 page=0 chnl=0 letter="%" 16 | char id=81 x=133 y=2 width=15 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="Q" 17 | char id=79 x=150 y=2 width=15 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="O" 18 | char id=71 x=167 y=2 width=14 height=16 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 letter="G" 19 | char id=67 x=183 y=2 width=14 height=16 xoffset=-1 yoffset=1 xadvance=10 page=0 chnl=0 letter="C" 20 | char id=38 x=199 y=2 width=13 height=16 xoffset=-1 yoffset=1 xadvance=9 page=0 chnl=0 letter="&" 21 | char id=83 x=214 y=2 width=13 height=16 xoffset=-1 yoffset=1 xadvance=9 page=0 chnl=0 letter="S" 22 | char id=35 x=229 y=2 width=12 height=16 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="#" 23 | char id=47 x=243 y=2 width=8 height=16 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="/" 24 | char id=92 x=2 y=22 width=8 height=16 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="\" 25 | char id=85 x=12 y=22 width=12 height=15 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="U" 26 | char id=51 x=26 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="3" 27 | char id=53 x=40 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="5" 28 | char id=54 x=54 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="6" 29 | char id=56 x=68 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="8" 30 | char id=57 x=82 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="9" 31 | char id=48 x=96 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="0" 32 | char id=63 x=110 y=22 width=12 height=15 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 letter="?" 33 | char id=98 x=124 y=22 width=12 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="b" 34 | char id=112 x=138 y=22 width=12 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="p" 35 | char id=121 x=152 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="y" 36 | char id=103 x=165 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="g" 37 | char id=100 x=178 y=22 width=11 height=15 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="d" 38 | char id=113 x=191 y=22 width=11 height=15 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="q" 39 | char id=74 x=204 y=22 width=10 height=15 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 letter="J" 40 | char id=102 x=216 y=22 width=9 height=15 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 letter="f" 41 | char id=116 x=227 y=22 width=8 height=15 xoffset=-1 yoffset=2 xadvance=4 page=0 chnl=0 letter="t" 42 | char id=87 x=237 y=22 width=17 height=14 xoffset=-1 yoffset=2 xadvance=13 page=0 chnl=0 letter="W" 43 | char id=77 x=2 y=40 width=14 height=14 xoffset=0 yoffset=2 xadvance=12 page=0 chnl=0 letter="M" 44 | char id=65 x=18 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="A" 45 | char id=86 x=34 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="V" 46 | char id=88 x=50 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="X" 47 | char id=89 x=66 y=40 width=14 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="Y" 48 | char id=82 x=82 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="R" 49 | char id=68 x=97 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="D" 50 | char id=75 x=112 y=40 width=13 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="K" 51 | char id=84 x=127 y=40 width=13 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="T" 52 | char id=90 x=142 y=40 width=13 height=14 xoffset=-1 yoffset=2 xadvance=9 page=0 chnl=0 letter="Z" 53 | char id=72 x=157 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="H" 54 | char id=78 x=171 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=10 page=0 chnl=0 letter="N" 55 | char id=66 x=185 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="B" 56 | char id=80 x=199 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="P" 57 | char id=69 x=213 y=40 width=12 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="E" 58 | char id=52 x=227 y=40 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="4" 59 | char id=50 x=241 y=40 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="2" 60 | char id=55 x=2 y=56 width=12 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="7" 61 | char id=70 x=16 y=56 width=11 height=14 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 letter="F" 62 | char id=76 x=29 y=56 width=11 height=14 xoffset=0 yoffset=2 xadvance=8 page=0 chnl=0 letter="L" 63 | char id=104 x=42 y=56 width=11 height=14 xoffset=-1 yoffset=2 xadvance=8 page=0 chnl=0 letter="h" 64 | char id=107 x=55 y=56 width=11 height=14 xoffset=-1 yoffset=2 xadvance=7 page=0 chnl=0 letter="k" 65 | char id=49 x=68 y=56 width=9 height=14 xoffset=0 yoffset=2 xadvance=8 page=0 chnl=0 letter="1" 66 | char id=105 x=79 y=56 width=7 height=14 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="i" 67 | char id=108 x=88 y=56 width=7 height=14 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="l" 68 | char id=73 x=97 y=56 width=6 height=14 xoffset=0 yoffset=2 xadvance=4 page=0 chnl=0 letter="I" 69 | char id=33 x=105 y=56 width=6 height=14 xoffset=0 yoffset=2 xadvance=4 page=0 chnl=0 letter="!" 70 | char id=59 x=113 y=56 width=6 height=14 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter=";" 71 | char id=111 x=121 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="o" 72 | char id=97 x=135 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="a" 73 | char id=101 x=149 y=56 width=12 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="e" 74 | char id=99 x=163 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="c" 75 | char id=115 x=176 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="s" 76 | char id=117 x=189 y=56 width=11 height=13 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="u" 77 | char id=109 x=202 y=56 width=15 height=12 xoffset=-1 yoffset=4 xadvance=12 page=0 chnl=0 letter="m" 78 | char id=119 x=219 y=56 width=14 height=12 xoffset=-1 yoffset=4 xadvance=10 page=0 chnl=0 letter="w" 79 | char id=60 x=235 y=56 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter="<" 80 | char id=62 x=2 y=72 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter=">" 81 | char id=43 x=16 y=72 width=12 height=12 xoffset=-1 yoffset=3 xadvance=8 page=0 chnl=0 letter="+" 82 | char id=118 x=30 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="v" 83 | char id=120 x=43 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="x" 84 | char id=122 x=56 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=7 page=0 chnl=0 letter="z" 85 | char id=110 x=69 y=72 width=11 height=12 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="n" 86 | char id=114 x=82 y=72 width=9 height=12 xoffset=-1 yoffset=4 xadvance=5 page=0 chnl=0 letter="r" 87 | char id=58 x=93 y=72 width=6 height=12 xoffset=0 yoffset=4 xadvance=4 page=0 chnl=0 letter=":" 88 | char id=94 x=101 y=72 width=11 height=11 xoffset=-1 yoffset=1 xadvance=7 page=0 chnl=0 letter="^" 89 | char id=61 x=114 y=72 width=12 height=10 xoffset=-1 yoffset=4 xadvance=8 page=0 chnl=0 letter="=" 90 | char id=42 x=128 y=72 width=9 height=9 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="*" 91 | char id=34 x=139 y=72 width=9 height=8 xoffset=-1 yoffset=2 xadvance=5 page=0 chnl=0 letter=""" 92 | char id=39 x=150 y=72 width=6 height=8 xoffset=-1 yoffset=2 xadvance=3 page=0 chnl=0 letter="'" 93 | char id=44 x=158 y=72 width=6 height=8 xoffset=0 yoffset=10 xadvance=4 page=0 chnl=0 letter="," 94 | char id=126 x=166 y=72 width=12 height=7 xoffset=-1 yoffset=6 xadvance=8 page=0 chnl=0 letter="~" 95 | char id=96 x=180 y=72 width=8 height=7 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 letter="`" 96 | char id=95 x=190 y=72 width=13 height=6 xoffset=-2 yoffset=13 xadvance=8 page=0 chnl=0 letter="_" 97 | char id=45 x=205 y=72 width=9 height=6 xoffset=-1 yoffset=7 xadvance=5 page=0 chnl=0 letter="-" 98 | char id=46 x=216 y=72 width=6 height=6 xoffset=0 yoffset=10 xadvance=4 page=0 chnl=0 letter="." 99 | char id=32 x=224 y=72 width=0 height=0 xoffset=0 yoffset=133 xadvance=4 page=0 chnl=0 letter="space" 100 | kernings count=82 101 | kerning first=64 second=42 amount=-1 102 | kerning first=79 second=102 amount=-1 103 | kerning first=79 second=82 amount=-1 104 | kerning first=47 second=52 amount=-1 105 | kerning first=63 second=126 amount=-1 106 | kerning first=121 second=44 amount=-1 107 | kerning first=121 second=46 amount=-1 108 | kerning first=87 second=65 amount=-1 109 | kerning first=87 second=97 amount=-1 110 | kerning first=87 second=44 amount=-1 111 | kerning first=87 second=46 amount=-1 112 | kerning first=65 second=87 amount=-1 113 | kerning first=65 second=86 amount=-1 114 | kerning first=65 second=89 amount=-1 115 | kerning first=65 second=84 amount=-1 116 | kerning first=65 second=32 amount=-1 117 | kerning first=86 second=121 amount=-1 118 | kerning first=86 second=65 amount=-1 119 | kerning first=86 second=59 amount=-1 120 | kerning first=86 second=111 amount=-1 121 | kerning first=86 second=97 amount=-1 122 | kerning first=86 second=101 amount=-1 123 | kerning first=86 second=117 amount=-1 124 | kerning first=86 second=114 amount=-1 125 | kerning first=86 second=58 amount=-1 126 | kerning first=86 second=44 amount=-1 127 | kerning first=86 second=45 amount=-1 128 | kerning first=86 second=46 amount=-1 129 | kerning first=89 second=112 amount=-1 130 | kerning first=89 second=113 amount=-1 131 | kerning first=89 second=65 amount=-1 132 | kerning first=89 second=105 amount=-1 133 | kerning first=89 second=59 amount=-1 134 | kerning first=89 second=111 amount=-1 135 | kerning first=89 second=97 amount=-1 136 | kerning first=89 second=101 amount=-1 137 | kerning first=89 second=117 amount=-1 138 | kerning first=89 second=118 amount=-1 139 | kerning first=89 second=58 amount=-1 140 | kerning first=89 second=44 amount=-2 141 | kerning first=89 second=45 amount=-1 142 | kerning first=89 second=46 amount=-2 143 | kerning first=84 second=121 amount=-1 144 | kerning first=84 second=65 amount=-1 145 | kerning first=84 second=105 amount=-1 146 | kerning first=84 second=59 amount=-2 147 | kerning first=84 second=111 amount=-2 148 | kerning first=84 second=97 amount=-2 149 | kerning first=84 second=101 amount=-2 150 | kerning first=84 second=99 amount=-2 151 | kerning first=84 second=115 amount=-2 152 | kerning first=84 second=117 amount=-1 153 | kerning first=84 second=119 amount=-1 154 | kerning first=84 second=114 amount=-1 155 | kerning first=84 second=58 amount=-2 156 | kerning first=84 second=44 amount=-2 157 | kerning first=84 second=45 amount=-1 158 | kerning first=84 second=46 amount=-2 159 | kerning first=80 second=65 amount=-1 160 | kerning first=80 second=62 amount=-1 161 | kerning first=80 second=44 amount=-2 162 | kerning first=80 second=46 amount=-2 163 | kerning first=70 second=65 amount=-1 164 | kerning first=70 second=44 amount=-2 165 | kerning first=70 second=46 amount=-2 166 | kerning first=76 second=121 amount=-1 167 | kerning first=76 second=87 amount=-1 168 | kerning first=76 second=86 amount=-1 169 | kerning first=76 second=89 amount=-1 170 | kerning first=76 second=84 amount=-1 171 | kerning first=76 second=32 amount=-1 172 | kerning first=49 second=49 amount=-1 173 | kerning first=33 second=102 amount=-1 174 | kerning first=119 second=44 amount=-1 175 | kerning first=119 second=46 amount=-1 176 | kerning first=62 second=35 amount=-1 177 | kerning first=118 second=44 amount=-1 178 | kerning first=118 second=46 amount=-1 179 | kerning first=114 second=44 amount=-1 180 | kerning first=114 second=46 amount=-1 181 | kerning first=32 second=92 amount=-1 182 | kerning first=32 second=65 amount=-1 183 | -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/arial-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/arial-14.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/b01.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | lvl1_map1.png 8 | 9 | frame 10 | {{0,0},{240,240}} 11 | offset 12 | {0,0} 13 | rotated 14 | 15 | sourceColorRect 16 | {{0,0},{240,240}} 17 | sourceSize 18 | {240,240} 19 | 20 | lvl1_map2.png 21 | 22 | frame 23 | {{240,0},{240,240}} 24 | offset 25 | {0,0} 26 | rotated 27 | 28 | sourceColorRect 29 | {{0,0},{240,240}} 30 | sourceSize 31 | {240,240} 32 | 33 | lvl1_map3.png 34 | 35 | frame 36 | {{0,240},{240,240}} 37 | offset 38 | {0,0} 39 | rotated 40 | 41 | sourceColorRect 42 | {{0,0},{240,240}} 43 | sourceSize 44 | {240,240} 45 | 46 | lvl1_map4.png 47 | 48 | frame 49 | {{240,240},{240,240}} 50 | offset 51 | {0,0} 52 | rotated 53 | 54 | sourceColorRect 55 | {{0,0},{240,240}} 56 | sourceSize 57 | {240,240} 58 | 59 | 60 | metadata 61 | 62 | format 63 | 2 64 | realTextureFileName 65 | b01.png 66 | size 67 | {512,512} 68 | textureFileName 69 | b01.png 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/b01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/b01.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/cocos2d-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/cocos2d-html5.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/explode.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/explode.plist -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/explosion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/explosion.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/flare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/flare.jpg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/gameOver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/gameOver.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/level01.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | H4sIAAAAAAAAC2NgGAWkAsaBdgAJgHmgHTAEAdNAO2AAActAO4AAAABYXSHTsAQAAA== 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/loading.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/logo.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/menu.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/menuTitle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/menuTitle.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/textureOpaquePack.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | W1.png 8 | 9 | frame 10 | {{2,232},{14,62}} 11 | offset 12 | {0,0} 13 | rotated 14 | 15 | sourceColorRect 16 | {{0,0},{14,62}} 17 | sourceSize 18 | {14,62} 19 | 20 | W2.png 21 | 22 | frame 23 | {{36,198},{25,25}} 24 | offset 25 | {0,0} 26 | rotated 27 | 28 | sourceColorRect 29 | {{0,0},{25,25}} 30 | sourceSize 31 | {25,25} 32 | 33 | explode1.png 34 | 35 | frame 36 | {{100,2},{96,96}} 37 | offset 38 | {0,0} 39 | rotated 40 | 41 | sourceColorRect 42 | {{0,0},{96,96}} 43 | sourceSize 44 | {96,96} 45 | 46 | explode2.png 47 | 48 | frame 49 | {{2,100},{96,96}} 50 | offset 51 | {0,0} 52 | rotated 53 | 54 | sourceColorRect 55 | {{0,0},{96,96}} 56 | sourceSize 57 | {96,96} 58 | 59 | explode3.png 60 | 61 | frame 62 | {{2,2},{96,96}} 63 | offset 64 | {0,0} 65 | rotated 66 | 67 | sourceColorRect 68 | {{0,0},{96,96}} 69 | sourceSize 70 | {96,96} 71 | 72 | hit.png 73 | 74 | frame 75 | {{2,198},{32,32}} 76 | offset 77 | {0,0} 78 | rotated 79 | 80 | sourceColorRect 81 | {{0,0},{32,32}} 82 | sourceSize 83 | {32,32} 84 | 85 | 86 | metadata 87 | 88 | format 89 | 2 90 | realTextureFileName 91 | textureOpaquePack.png 92 | size 93 | {256,256} 94 | textureFileName 95 | textureOpaquePack.png 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/textureOpaquePack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/textureOpaquePack.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/textureTransparentPack.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | frames 6 | 7 | E0.png 8 | 9 | frame 10 | {{324,89},{46,26}} 11 | offset 12 | {-1,0} 13 | rotated 14 | 15 | sourceColorRect 16 | {{0,1},{46,26}} 17 | sourceSize 18 | {48,28} 19 | 20 | E1.png 21 | 22 | frame 23 | {{473,2},{55,31}} 24 | offset 25 | {-1,0} 26 | rotated 27 | 28 | sourceColorRect 29 | {{2,0},{55,31}} 30 | sourceSize 31 | {61,31} 32 | 33 | E2.png 34 | 35 | frame 36 | {{469,59},{55,41}} 37 | offset 38 | {1,-1} 39 | rotated 40 | 41 | sourceColorRect 42 | {{2,3},{55,41}} 43 | sourceSize 44 | {57,45} 45 | 46 | E3.png 47 | 48 | frame 49 | {{406,2},{65,31}} 50 | offset 51 | {1,0} 52 | rotated 53 | 54 | sourceColorRect 55 | {{2,0},{65,31}} 56 | sourceSize 57 | {67,31} 58 | 59 | E4.png 60 | 61 | frame 62 | {{324,49},{61,38}} 63 | offset 64 | {0,-1} 65 | rotated 66 | 67 | sourceColorRect 68 | {{1,2},{61,38}} 69 | sourceSize 70 | {63,40} 71 | 72 | E5.png 73 | 74 | frame 75 | {{324,2},{80,45}} 76 | offset 77 | {0,0} 78 | rotated 79 | 80 | sourceColorRect 81 | {{2,1},{80,45}} 82 | sourceSize 83 | {84,47} 84 | 85 | bg01.png 86 | 87 | frame 88 | {{2,2},{320,575}} 89 | offset 90 | {0,0} 91 | rotated 92 | 93 | sourceColorRect 94 | {{0,0},{320,575}} 95 | sourceSize 96 | {320,575} 97 | 98 | ship01.png 99 | 100 | frame 101 | {{449,116},{59,45}} 102 | offset 103 | {0,0} 104 | rotated 105 | 106 | sourceColorRect 107 | {{0,0},{59,45}} 108 | sourceSize 109 | {59,45} 110 | 111 | ship02.png 112 | 113 | frame 114 | {{406,35},{61,44}} 115 | offset 116 | {0,0} 117 | rotated 118 | 119 | sourceColorRect 120 | {{0,0},{61,44}} 121 | sourceSize 122 | {61,44} 123 | 124 | ship03.png 125 | 126 | frame 127 | {{387,81},{60,38}} 128 | offset 129 | {0,0} 130 | rotated 131 | 132 | sourceColorRect 133 | {{0,0},{60,38}} 134 | sourceSize 135 | {60,38} 136 | 137 | 138 | metadata 139 | 140 | format 141 | 2 142 | realTextureFileName 143 | textureTransparentPack.png 144 | size 145 | {512,1024} 146 | textureFileName 147 | textureTransparentPack.png 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /源代码/moonwarriors/res/ImageRaw/textureTransparentPack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/ImageRaw/textureTransparentPack.png -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/bgMusic.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/bgMusic.mp3 -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/bgMusic.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/bgMusic.ogg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/buttonEffet.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/buttonEffet.mp3 -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/buttonEffet.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/buttonEffet.ogg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/explodeEffect.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/explodeEffect.mp3 -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/explodeEffect.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/explodeEffect.ogg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/fireEffect.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/fireEffect.mp3 -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/fireEffect.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/fireEffect.ogg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/mainMainMusic.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/mainMainMusic.mp3 -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/mainMainMusic.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/mainMainMusic.ogg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/shipDestroyEffect.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/shipDestroyEffect.mp3 -------------------------------------------------------------------------------- /源代码/moonwarriors/res/Music/shipDestroyEffect.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/Music/shipDestroyEffect.ogg -------------------------------------------------------------------------------- /源代码/moonwarriors/res/framework_precompiled.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/framework_precompiled.zip -------------------------------------------------------------------------------- /源代码/moonwarriors/res/game.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/源代码/moonwarriors/res/game.zip -------------------------------------------------------------------------------- /源代码/moonwarriors/run-mac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 3 | 4 | BIN="$DIR/proj.mac/bin/moonwarriors.app/Contents/MacOS/moonwarriors" 5 | if [ ! -f $BIN ]; then 6 | echo "PLEASE BUILD proj.mac/moonwarriors.xcodeproj FIRST" 7 | exit 8 | fi 9 | 10 | ARG="-relaunch-off -quick $QUICK_COCOS2DX_ROOT -workdir $DIR" 11 | SIZE="-portrait" 12 | CMD="$BIN $ARG $SIZE" 13 | 14 | until $CMD; do 15 | echo "" 16 | echo "------------------------------------------------------" 17 | echo "" 18 | echo "" 19 | echo "" 20 | done 21 | -------------------------------------------------------------------------------- /源代码/moonwarriors/run-win.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | E:\Demo\cocos2d-x\quick-cocos2d-x-2.2.5\player\win\player.exe -workdir E:\Demo\cocos2d-x\quick-cocos2d-x-2.2.5\projects\moonwarriors -file scripts\main.lua -size 320x480 -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/Background.lua: -------------------------------------------------------------------------------- 1 | local BackSky = class("BackSky", function() 2 | return display.newSprite("#bg01.png") 3 | end) 4 | 5 | function BackSky:ctor() 6 | self.active = true 7 | self:setAnchorPoint(0, 0) 8 | end 9 | 10 | function BackSky:destroy() 11 | self:setVisible(false) 12 | self.active = false 13 | end 14 | 15 | function BackSky.create() 16 | local background = BackSky.new() 17 | g_sharedGameLayer:addChild(background, -10) 18 | table.insert(MW.CONTAINER.BACKSKYS, background) 19 | return background 20 | end 21 | 22 | function BackSky.getOrCreate() 23 | local selChild = nil 24 | for j = 1, #MW.CONTAINER.BACKSKYS do 25 | selChild = MW.CONTAINER.BACKSKYS[j] 26 | if (selChild.active == false) then 27 | selChild:setVisible(true) 28 | selChild.active = true 29 | return selChild 30 | end 31 | end 32 | selChild = BackSky.create() 33 | return selChild 34 | end 35 | 36 | function BackSky.preSet() 37 | local background = null 38 | for i = 1, 2 do 39 | background = BackSky.create() 40 | background:setVisible(false) 41 | background.active = false 42 | end 43 | end 44 | 45 | local BackTileMapLvl1 = { 46 | "lvl1_map1.png", 47 | "lvl1_map2.png", 48 | "lvl1_map3.png", 49 | "lvl1_map4.png" 50 | } 51 | 52 | local BackTileMap = class("BackTileMap", function() 53 | return display.newSprite() 54 | end) 55 | 56 | function BackTileMap:ctor(frameName) 57 | self.active = true 58 | self:setDisplayFrame(display.newSpriteFrame(frameName)) 59 | self:setAnchorPoint(0.5, 0) 60 | end 61 | 62 | function BackTileMap:destroy() 63 | self:setVisible(false) 64 | self.active = false 65 | end 66 | 67 | function BackTileMap.create(frameName) 68 | local backTileMap = BackTileMap.new(frameName) 69 | g_sharedGameLayer:addChild(backTileMap, -9) 70 | table.insert(MW.CONTAINER.BACKTILEMAPS, backTileMap) 71 | return backTileMap 72 | end 73 | 74 | function BackTileMap.getOrCreate() 75 | local selChild = nil 76 | for j = 1, #MW.CONTAINER.BACKTILEMAPS do 77 | selChild = MW.CONTAINER.BACKTILEMAPS[j] 78 | if (selChild.active == false) then 79 | selChild:setVisible(true) 80 | selChild.active = true 81 | return selChild 82 | end 83 | end 84 | selChild = BackTileMap.create(BackTileMapLvl1[math.random()*4]) 85 | return selChild 86 | end 87 | 88 | function BackTileMap.preSet() 89 | local backTileMap = nil 90 | for i = 1, #BackTileMapLvl1 do 91 | backTileMap = BackTileMap.create(BackTileMapLvl1[i]) 92 | backTileMap:setVisible(false) 93 | backTileMap.active = false 94 | end 95 | end 96 | 97 | local Bg = {} 98 | Bg.BackSky = BackSky 99 | Bg.BackTileMap = BackTileMap 100 | return Bg -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/Bullet.lua: -------------------------------------------------------------------------------- 1 | local HitEffect = require("HitEffect") 2 | 3 | -- 子弹类 4 | local Bullet = class("Bullet", function() 5 | return display.newSprite() 6 | end) 7 | 8 | -- 构造函数 9 | function Bullet:ctor(bulletSpeed, weaponType, attackMode) 10 | self.active = true 11 | self.xVelocity = 0 12 | self.yVelocity = 200 13 | self.power = 1 14 | self.HP = 1 15 | self.moveType = nil 16 | self.zOrder = 3000 17 | self.attackMode = MW.ENEMY_MOVE_TYPE.NORMAL 18 | self.parentType = MW.BULLET_TYPE.PLAYER 19 | 20 | self.yVelocity = -bulletSpeed 21 | self.attackMode = attackMode 22 | self:setDisplayFrame(display.newSpriteFrame(weaponType)) 23 | local blendFunc = ccBlendFunc:new() 24 | blendFunc.src = GL_SRC_ALPHA 25 | blendFunc.dst = GL_ONE 26 | self:setBlendFunc(blendFunc) 27 | end 28 | 29 | function Bullet:update(dt) 30 | local x, y = self:getPosition() 31 | self:setPosition(x - self.xVelocity * dt, y - self.yVelocity * dt) 32 | if (x < 0 or x > g_sharedGameLayer.screenRect.width 33 | or y < 0 or y > g_sharedGameLayer.screenRect.height 34 | or self.HP <= 0) then 35 | self:destroy() 36 | end 37 | end 38 | 39 | function Bullet:destroy() 40 | local x, y = self:getPosition() 41 | local explode = HitEffect.getOrCreateHitEffect( 42 | x, y, math.random() * 360, 0.75) 43 | self.active = false 44 | self:setVisible(false) 45 | end 46 | 47 | -- 损害 48 | function Bullet:hurt() 49 | self.HP = self.HP - 1 50 | end 51 | 52 | -- 碰撞矩形 53 | function Bullet:collideRect(x, y) 54 | return cc.rect(x - 3, y - 3, 6, 6) 55 | end 56 | 57 | function Bullet.getOrCreateBullet(bulletSpeed, 58 | weaponType, attackMode, zOrder, mode) 59 | local selChild = nil 60 | if (mode == MW.UNIT_TAG.PLAYER_BULLET) then -- 玩家子弹 61 | for i = 1, #MW.CONTAINER.PLAYER_BULLETS do 62 | selChild = MW.CONTAINER.PLAYER_BULLETS[i] 63 | if (selChild.active == false) then 64 | selChild:setVisible(true) 65 | selChild.HP = 1 66 | selChild.active = true 67 | return selChild 68 | end 69 | end 70 | else -- 敌机子弹 71 | for i = 1, #MW.CONTAINER.ENEMY_BULLETS do 72 | selChild = MW.CONTAINER.ENEMY_BULLETS[i] 73 | if (selChild.active == false) then 74 | selChild:setVisible(true) 75 | selChild.HP = 1 76 | selChild.active = true 77 | return selChild 78 | end 79 | end 80 | end 81 | selChild = Bullet.create(bulletSpeed, weaponType, attackMode, zOrder, mode) 82 | return selChild 83 | end 84 | 85 | function Bullet.create(bulletSpeed, 86 | weaponType, attackMode, zOrder, mode) 87 | local bullet = Bullet.new(bulletSpeed, weaponType, attackMode) 88 | g_sharedGameLayer:addBullet(bullet, zOrder, mode) 89 | if (mode == MW.UNIT_TAG.PLAYER_BULLET) then 90 | table.insert(MW.CONTAINER.PLAYER_BULLETS, bullet) 91 | else 92 | table.insert(MW.CONTAINER.ENEMY_BULLETS, bullet) 93 | end 94 | return bullet 95 | end 96 | 97 | function Bullet.preSet() 98 | local bullet = nil 99 | for i = 1, 10 do 100 | local bullet = Bullet.create(MW.BULLET_SPEED.SHIP, "W1.png", MW.ENEMY_ATTACK_MODE.NORMAL, 3000, MW.UNIT_TAG.PLAYER_BULLET) 101 | bullet:setVisible(false) 102 | bullet.active = false 103 | end 104 | for i = 1, 10 do 105 | bullet = Bullet.create(MW.BULLET_SPEED.ENEMY, "W2.png", MW.ENEMY_ATTACK_MODE.NORMAL, 3000, MW.UNIT_TAG.ENMEY_BULLET) 106 | bullet:setVisible(false) 107 | bullet.active = false 108 | end 109 | end 110 | 111 | return Bullet -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/Effect.lua: -------------------------------------------------------------------------------- 1 | -- 闪光特效 2 | function flareEffect(flare, target, callback) 3 | flare:setVisible(true) 4 | flare:stopAllActions() 5 | local blendFunc = ccBlendFunc:new() 6 | blendFunc.src = GL_SRC_ALPHA 7 | blendFunc.dst = GL_ONE 8 | flare:setBlendFunc(blendFunc) 9 | flare:setOpacity(0) 10 | flare:setPosition(-30, display.height-(480-297)) 11 | flare:setRotation(-120) 12 | flare:setScale(0.2) 13 | 14 | local opacityAnim = cc.FadeTo:create(0.5, 255) 15 | local opacDim = cc.FadeTo:create(1, 0) 16 | local biggeAnim = cc.ScaleBy:create(0.7, 1.2, 1.2) 17 | local biggerEase = cc.EaseSineOut:create(biggeAnim) 18 | local moveAnim = cc.MoveBy:create(0.5, cc.p(328, 0)) 19 | local easeMove = cc.EaseSineOut:create(moveAnim) 20 | local rotateAnim = cc.RotateBy:create(2.5, 90) 21 | local rotateEase = cc.EaseExponentialOut:create(rotateAnim) 22 | local bigger = cc.ScaleTo:create(0.5, 1) 23 | 24 | local onComplete = cc.CallFuncN:create(callback) 25 | local killflare = cc.CallFunc:create(function() 26 | flare:getParent():removeChild(self, true) 27 | end) 28 | 29 | local array = CCArray:create() 30 | array:addObject(opacityAnim) 31 | array:addObject(biggerEase) 32 | array:addObject(opacDim) 33 | array:addObject(killflare) 34 | array:addObject(onComplete) 35 | flare:runAction(cc.Sequence:create(array)) 36 | flare:runAction(easeMove) 37 | flare:runAction(rotateEase) 38 | flare:runAction(bigger) 39 | end 40 | 41 | function removeFromParent(sprite) 42 | sprite:removeFromParent() 43 | end 44 | 45 | function spark(ccpoint, parent, scale, duration) 46 | scale = scale or 0.3 47 | duration = duration or 0.5 48 | 49 | local one = display.newSprite("#explode1.png") 50 | local two = display.newSprite("#explode2.png") 51 | local three = display.newSprite("#explode3.png") 52 | 53 | one:setPosition(ccpoint) 54 | two:setPosition(ccpoint) 55 | three:setPosition(ccpoint) 56 | 57 | -- parent.addChild(one); 58 | parent:addSpark(two) 59 | parent:addSpark(three) 60 | one:setScale(scale) 61 | two:setScale(scale) 62 | three:setScale(scale) 63 | 64 | three:setRotation(math.random() * 360) 65 | 66 | local left = cc.RotateBy:create(duration, -45) 67 | local right = cc.RotateBy:create(duration, 45) 68 | local scaleBy = cc.ScaleBy:create(duration, 3, 3) 69 | local fadeOut = cc.FadeOut:create(duration) 70 | local remove = cc.CallFuncN:create(removeFromParent) 71 | local array = CCArray:create() 72 | array:addObject(fadeOut) 73 | array:addObject(remove) 74 | local seq = cc.Sequence:create(array) 75 | 76 | one:runAction(left) 77 | two:runAction(right) 78 | 79 | one:runAction(scaleBy) 80 | two:runAction(clone(scaleBy)) 81 | three:runAction(clone(scaleBy)) 82 | 83 | one:runAction(seq) 84 | two:runAction(clone(seq)) 85 | three:runAction(clone(seq)) 86 | end 87 | 88 | -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/Enemy.lua: -------------------------------------------------------------------------------- 1 | local EnemyType = require("config.EnemyType") 2 | local Bullet = require("Bullet") 3 | local Explosion = require("Explosion") 4 | local SparkEffect = require("SparkEffect") 5 | local scheduler = require("framework.scheduler") 6 | 7 | -- 敌机类 8 | local Enemy = class("Enemy", function() 9 | return display.newSprite() 10 | end) 11 | 12 | -- 构造函数 13 | function Enemy:ctor(arg) 14 | self.eID = 0 15 | self.enemyType = 1 16 | self.active = true 17 | self.speed = 200 18 | self.bulletSpeed = MW.BULLET_SPEED.ENEMY 19 | self.HP = 15 20 | self.bulletPowerValue = 1 21 | self.moveType = nil 22 | self.scoreValue = 200 23 | self.zOrder = 1000 24 | self.delayTime = 1 + 1.2 * math.random() 25 | self.attackMode = MW.ENEMY_MOVE_TYPE.NORMAL 26 | self._hurtColorLife = 0 27 | self.HP = arg.HP 28 | self.moveType = arg.moveType 29 | self.scoreValue = arg.scoreValue 30 | self.attackMode = arg.attackMode 31 | self.enemyType = arg.type 32 | self._timeTick = 0 33 | 34 | self:setDisplayFrame(display.newSpriteFrame(arg.textureName)) 35 | self:schedule(handler(self, self.shoot), self.delayTime) 36 | -- self.handle = scheduler.scheduleGlobal(handler(self, self.shoot), self.delayTime) 37 | end 38 | 39 | function Enemy:update(dt) 40 | local x, y = self:getPosition() 41 | if ((x < 0 or x > 320) and (y < 0 or y > 480)) then 42 | self.active = false 43 | end 44 | self._timeTick = self._timeTick + dt 45 | if (self._timeTick > 0.1) then 46 | self._timeTick = 0 47 | if (self._hurtColorLife > 0) then 48 | self._hurtColorLife = self._hurtColorLife - 1 49 | end 50 | end 51 | 52 | x, y = self:getPosition() 53 | if (x < 0 or x > g_sharedGameLayer.screenRect.width 54 | or y < 0 or y > g_sharedGameLayer.screenRect.height 55 | or self.HP <= 0) then 56 | self.active = false 57 | self:destroy() 58 | end 59 | end 60 | 61 | function Enemy:destroy() 62 | MW.SCORE = MW.SCORE + self.scoreValue 63 | local a = Explosion.getOrCreateExplosion() 64 | local x, y = self:getPosition() 65 | a:setPosition(x, y) 66 | SparkEffect.getOrCreateSparkEffect(x, y) 67 | if (MW.SOUND) then 68 | audio.playSound(res.explodeEffect_mp3) 69 | end 70 | self:setVisible(false) 71 | self.active = false 72 | self:stopAllActions() 73 | --self:unschedule(self.shoot) 74 | --scheduler.unscheduleGlobal(self.handle) 75 | MW.ACTIVE_ENEMIES = MW.ACTIVE_ENEMIES - 1 76 | end 77 | 78 | -- 射击 79 | function Enemy:shoot() 80 | local x, y = self:getPosition() 81 | local b = Bullet.getOrCreateBullet(self.bulletSpeed, "W2.png", self.attackMode, 3000, MW.UNIT_TAG.ENMEY_BULLET) 82 | b:setPosition(x, y - self:getContentSize().height * 0.2) 83 | end 84 | 85 | -- 损害 86 | function Enemy:hurt() 87 | self._hurtColorLife = 2 88 | self.HP = self.HP - 1 89 | end 90 | 91 | -- 碰撞矩形 92 | function Enemy:collideRect(x, y) 93 | local a = self:getContentSize() 94 | return cc.rect(x - a.width / 2, y - a.height / 4, a.width, a.height / 2+20) 95 | end 96 | 97 | function Enemy.getOrCreateEnemy(arg) 98 | local selChild = nil 99 | for j = 1, #MW.CONTAINER.ENEMIES do 100 | selChild = MW.CONTAINER.ENEMIES[j] 101 | 102 | if (selChild.active == false and selChild.enemyType == arg.type) then 103 | selChild.HP = arg.HP 104 | selChild.active = true 105 | selChild.moveType = arg.moveType 106 | selChild.scoreValue = arg.scoreValue 107 | selChild.attackMode = arg.attackMode 108 | selChild._hurtColorLife = 0 109 | 110 | selChild:schedule(handler(selChild, selChild.shoot), selChild.delayTime) 111 | -- selChild.handle = scheduler.scheduleGlobal(handler(selChild, selChild.shoot), selChild.delayTime) 112 | selChild:setVisible(true) 113 | MW.ACTIVE_ENEMIES = MW.ACTIVE_ENEMIES + 1 114 | return selChild 115 | end 116 | end 117 | selChild = Enemy.create(arg) 118 | MW.ACTIVE_ENEMIES = MW.ACTIVE_ENEMIES + 1 119 | return selChild 120 | end 121 | 122 | function Enemy.create(arg) 123 | local enemy = Enemy.new(arg) 124 | g_sharedGameLayer:addEnemy(enemy, enemy.zOrder, MW.UNIT_TAG.ENEMY) 125 | table.insert(MW.CONTAINER.ENEMIES, enemy) 126 | return enemy 127 | end 128 | 129 | function Enemy.preSet() 130 | local enemy = nil 131 | for i = 1, 3 do 132 | for j = 1, #EnemyType do 133 | enemy = Enemy.create(EnemyType[j]) 134 | enemy:setVisible(false) 135 | enemy.active = false 136 | enemy:stopAllActions() 137 | --enemy:unscheduleAllCallbacks() 138 | end 139 | end 140 | end 141 | 142 | return Enemy -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/Explosion.lua: -------------------------------------------------------------------------------- 1 | -- 爆炸类 2 | local Explosion = class("Explosion", function() 3 | return display.newSprite("#explosion_01.png") 4 | end) 5 | 6 | -- 构造函数 7 | function Explosion:ctor() 8 | self.tmpWidth = 0 9 | self.tmpHeight = 0 10 | self.active = true 11 | 12 | local blendFunc = ccBlendFunc:new() 13 | blendFunc.src = GL_SRC_ALPHA 14 | blendFunc.dst = GL_ONE 15 | self:setBlendFunc(blendFunc) 16 | 17 | local sz = self:getContentSize() 18 | self.tmpWidth = sz.width 19 | self.tmpHeight = sz.height 20 | self.animation = display.getAnimationCache("Explosion") 21 | end 22 | 23 | -- 播放爆炸动画 24 | function Explosion:play() 25 | local array = CCArray:create() 26 | array:addObject(cc.Animate:create(self.animation)) 27 | array:addObject(cc.CallFunc:create(handler(self, self.destroy))) 28 | self:runAction(cc.Sequence:create(array)) 29 | end 30 | 31 | function Explosion:destroy() 32 | self:setVisible(false) 33 | self.active = false 34 | self:stopAllActions() 35 | end 36 | 37 | function Explosion.sharedExplosion() 38 | local frames = display.newFrames("explosion_%02d.png", 1, 35) 39 | local animation = display.newAnimation(frames, 0.04) 40 | display.setAnimationCache("Explosion", animation) 41 | end 42 | 43 | function Explosion.getOrCreateExplosion() 44 | local selChild = nil 45 | for i = 1, #MW.CONTAINER.EXPLOSIONS do 46 | selChild = MW.CONTAINER.EXPLOSIONS[i] 47 | if (selChild.active == false) then 48 | selChild:setVisible(true) 49 | selChild.active = true 50 | selChild:play() 51 | return selChild 52 | end 53 | end 54 | selChild = Explosion.create() 55 | selChild:play() 56 | return selChild 57 | end 58 | 59 | function Explosion.create() 60 | local explosion = Explosion.new() 61 | g_sharedGameLayer:addExplosions(explosion) 62 | table.insert(MW.CONTAINER.EXPLOSIONS, explosion) 63 | return explosion 64 | end 65 | 66 | function Explosion.preSet() 67 | local explosion = nil 68 | for i = 1, 6 do 69 | explosion = Explosion.create() 70 | explosion:setVisible(false) 71 | explosion.active = false 72 | end 73 | end 74 | 75 | return Explosion -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/HitEffect.lua: -------------------------------------------------------------------------------- 1 | -- 打击特效 2 | local HitEffect = class("HitEffect", function() 3 | return display.newSprite("#hit.png") 4 | end) 5 | 6 | -- 构造函数 7 | function HitEffect:ctor() 8 | self.active = true 9 | 10 | local blendFunc = ccBlendFunc:new() 11 | blendFunc.src = GL_SRC_ALPHA 12 | blendFunc.dst = GL_ONE 13 | self:setBlendFunc(blendFunc) 14 | end 15 | 16 | function HitEffect:reset(x, y, rotation, scale) 17 | self:setPosition(cc.p(x, y)) 18 | self:setRotation(rotation) 19 | self:setScale(scale) 20 | self:runAction(cc.ScaleBy:create(0.3, 2, 2)) 21 | local array = CCArray:create() 22 | array:addObject(cc.FadeOut:create(0.3)) 23 | array:addObject(cc.CallFunc:create(handler(self, self.destroy))) 24 | self:runAction(cc.Sequence:create(array)) 25 | end 26 | 27 | function HitEffect:destroy() 28 | self:setVisible(false) 29 | self.active = false 30 | end 31 | 32 | function HitEffect.getOrCreateHitEffect(x, y, rotation, scale) 33 | local selChild = nil 34 | for i = 1, #MW.CONTAINER.HITS do 35 | selChild = MW.CONTAINER.HITS[i] 36 | if (selChild.active == false) then 37 | selChild:setVisible(true) 38 | selChild.active = true 39 | selChild:reset(x, y, rotation, scale) 40 | return selChild 41 | end 42 | end 43 | selChild = HitEffect.create() 44 | selChild:reset(x, y, rotation, scale) 45 | return selChild 46 | end 47 | 48 | function HitEffect.create() 49 | local hitEffect = HitEffect.new() 50 | g_sharedGameLayer:addBulletHits(hitEffect, 9999) 51 | table.insert(MW.CONTAINER.HITS, hitEffect) 52 | return hitEffect 53 | end 54 | 55 | function HitEffect.preSet() 56 | local hitEffect = nil 57 | for i = 1, 10 do 58 | hitEffect = HitEffect.create() 59 | hitEffect:setVisible(false) 60 | hitEffect.active = false 61 | end 62 | end 63 | 64 | return HitEffect -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/LevelManager.lua: -------------------------------------------------------------------------------- 1 | require("config.Level") 2 | local Enemy = require("Enemy") 3 | local EnemyType = require("config.EnemyType") 4 | 5 | -- 等级管理器 6 | local LevelManager = class("LevelManager") 7 | 8 | -- 构造函数 9 | function LevelManager:ctor(gameLayer) 10 | if not gameLayer then 11 | print("gameLayer must be non-nil") 12 | return 13 | end 14 | 15 | self._gameLayer = gameLayer 16 | self:setLevel(Level1) 17 | end 18 | 19 | -- 设置等级 20 | function LevelManager:setLevel(level) 21 | local enemies = level.enemies 22 | for i = 1, #level.enemies do 23 | enemies[i].ShowTime = self:_minuteToSecond(enemies[i].ShowTime) 24 | end 25 | self._currentLevel = level 26 | end 27 | 28 | -- 分转换为秒 29 | function LevelManager:_minuteToSecond(minuteStr) 30 | if not minuteStr then 31 | return 0 32 | end 33 | 34 | if (type(minuteStr) ~= "number") then 35 | local mins = minuteStr:split(':') 36 | if (#mins == 1) then 37 | return tonumber(mins[1]) 38 | else 39 | return tonumber(mins[1])* 60 + tonumber(mins[2]) 40 | end 41 | else 42 | return minuteStr 43 | end 44 | end 45 | 46 | function LevelManager:loadLevelResource(deltaTime) 47 | if (MW.ACTIVE_ENEMIES >= self._currentLevel.enemyMax) then 48 | return 49 | end 50 | 51 | -- load enemy 52 | local locCurrentLevel = self._currentLevel 53 | for i = 1, #locCurrentLevel.enemies do 54 | local selEnemy = locCurrentLevel.enemies[i] 55 | if selEnemy then 56 | if selEnemy.ShowType == "Once" then 57 | if selEnemy.ShowTime == deltaTime then 58 | for tIndex = 1, #selEnemy.Types do 59 | self:addEnemyToGameLayer(selEnemy.Types[tIndex]) 60 | end 61 | end 62 | elseif selEnemy.ShowType == "Repeate" then 63 | if deltaTime % selEnemy.ShowTime == 0 then 64 | for rIndex = 1, #selEnemy.Types do 65 | self:addEnemyToGameLayer(selEnemy.Types[rIndex]) 66 | end 67 | end 68 | end 69 | end 70 | end 71 | end 72 | 73 | function LevelManager:addEnemyToGameLayer(enemyType) 74 | local addEnemy = Enemy.getOrCreateEnemy(EnemyType[enemyType+1]) 75 | local enemypos = cc.p( 80 + (display.width - 160) * math.random(), display.height) 76 | local enemycs = addEnemy:getContentSize() 77 | addEnemy:setPosition( enemypos ) 78 | 79 | local x, y 80 | local offset, tmpAction 81 | local a0 = 0 82 | local a1 = 0 83 | if addEnemy.moveType == MW.ENEMY_MOVE_TYPE.ATTACK then 84 | x, y = self._gameLayer._ship:getPosition() 85 | tmpAction = cc.MoveTo:create(1, cc.p(x, y)) 86 | elseif addEnemy.moveType == MW.ENEMY_MOVE_TYPE.VERTICAL then 87 | offset = cc.p(0, -display.height - enemycs.height) 88 | tmpAction = cc.MoveBy:create(4, offset) 89 | elseif addEnemy.moveType == MW.ENEMY_MOVE_TYPE.HORIZONTAL then 90 | offset = cc.p(0, -100 - 200 * math.random()) 91 | a0 = cc.MoveBy:create(0.5, offset) 92 | a1 = cc.MoveBy:create(1, cc.p(-50 - 100 * math.random(), 0)) 93 | local onComplete = cc.CallFuncN:create(function (pSender) 94 | local a2 = cc.DelayTime:create(1) 95 | local a3 = cc.MoveBy:create(1, cc.p(100 + 100 * math.random(), 0)) 96 | local array = CCArray:create() 97 | array:addObject(a2) 98 | array:addObject(a3) 99 | -- array:addObject(a2:clone()) 100 | array:addObject(clone(a2)) 101 | array:addObject(a3:reverse()) 102 | pSender:runAction(cc.RepeatForever:create( 103 | cc.Sequence:create(array) 104 | )) 105 | end) 106 | local array = CCArray:create() 107 | array:addObject(a0) 108 | array:addObject(a1) 109 | array:addObject(onComplete) 110 | tmpAction = cc.Sequence:create(array) 111 | elseif addEnemy.moveType == MW.ENEMY_MOVE_TYPE.OVERLAP then 112 | local newX = ((enemypos.x <= display.width / 2) and 320) or -320 113 | a0 = cc.MoveBy:create(4, cc.p(newX, -240)) 114 | a1 = cc.MoveBy:create(4,cc.p(-newX,-320)) 115 | local array = CCArray:create() 116 | array:addObject(a0) 117 | array:addObject(a1) 118 | tmpAction = cc.Sequence:create(array) 119 | end 120 | 121 | addEnemy:runAction(tmpAction) 122 | end 123 | 124 | return LevelManager -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/Ship.lua: -------------------------------------------------------------------------------- 1 | local Bullet = require("Bullet") 2 | local Explosion = require("Explosion") 3 | 4 | -- 玩家战机类 5 | local Ship = class("Ship", function() 6 | return display.newSprite("#ship01.png") 7 | end) 8 | 9 | -- 构造函数 10 | function Ship:ctor() 11 | self.speed = 220 12 | self.bulletSpeed = MW.BULLET_SPEED.SHIP 13 | self.HP = 5 14 | self.bulletTypeValue = 1 15 | self.bulletPowerValue = 1 16 | self.throwBombing = false 17 | self.canBeAttack = true 18 | self.isThrowingBomb = false 19 | self.zOrder = 3000 20 | self.maxBulletPowerValue = 4 21 | self.appearPosition = cc.p(160, 60) 22 | self._hurtColorLife = 0 23 | self.active = true 24 | self.bornSprite = nil 25 | self._timeTick = 0 26 | 27 | -- init life 28 | self:setTag(self.zOrder) 29 | self:setPosition(self.appearPosition) 30 | 31 | -- ship animate 32 | local frames = display.newFrames("ship%02d.png", 1, 2) 33 | local animation = display.newAnimation(frames, 0.1) 34 | local animate = cc.Animate:create(animation) 35 | self:runAction(cc.RepeatForever:create(animate)) 36 | self:schedule(handler(self, self.shoot), 1 / 6) 37 | 38 | self:initBornSprite() 39 | self:born() 40 | end 41 | 42 | function Ship:update(dt) 43 | -- Keys are only enabled on the browser 44 | -- if (sys.platform == "browser") then 45 | -- local x, y = self:getPosition() 46 | -- if ((MW.KEYS[cc.KEY.w] or MW.KEYS[cc.KEY.up]) and y <= display.height) then 47 | -- y = y + dt * self.speed 48 | -- end 49 | -- 50 | -- if ((MW.KEYS[cc.KEY.s] or MW.KEYS[cc.KEY.down]) and y >= 0) then 51 | -- y = y - dt * self.speed 52 | -- end 53 | -- 54 | -- if ((MW.KEYS[cc.KEY.a] or MW.KEYS[cc.KEY.left]) and x >= 0) then 55 | -- x = x - dt * self.speed 56 | -- end 57 | -- 58 | -- if ((MW.KEYS[cc.KEY.d] or MW.KEYS[cc.KEY.right]) and x <= display.width) then 59 | -- x = x + dt * self.speed 60 | -- end 61 | -- 62 | -- self:setPosition(cc.p(x, y)) 63 | -- end 64 | 65 | if (self.HP <= 0) then 66 | self.active = false 67 | self:destroy() 68 | end 69 | 70 | self._timeTick = self._timeTick + dt 71 | if (self._timeTick > 0.1) then 72 | self._timeTick = 0 73 | if (self._hurtColorLife > 0) then 74 | self._hurtColorLife = self._hurtColorLife - 1 75 | end 76 | end 77 | end 78 | 79 | -- 射击 80 | function Ship:shoot(dt) 81 | -- this.shootEffect(); 82 | local offset = 13 83 | local x, y = self:getPosition() 84 | local cs = self:getContentSize() 85 | local a = Bullet.getOrCreateBullet(self.bulletSpeed, "W1.png", MW.ENEMY_ATTACK_MODE.NORMAL, 3000, MW.UNIT_TAG.PLAYER_BULLET) 86 | a:setPosition(x + offset, y + 3 + cs.height * 0.3) 87 | 88 | local b = Bullet.getOrCreateBullet(self.bulletSpeed, "W1.png", MW.ENEMY_ATTACK_MODE.NORMAL, 3000, MW.UNIT_TAG.PLAYER_BULLET) 89 | b:setPosition(x - offset, y + 3 + cs.height * 0.3) 90 | end 91 | 92 | function Ship:destroy() 93 | MW.LIFE = MW.LIFE - 1 94 | 95 | local explosion = Explosion.getOrCreateExplosion() 96 | explosion:setPosition(self:getPosition()) 97 | 98 | if (MW.SOUND) then 99 | audio.playSound(res.shipDestroyEffect_mp3) 100 | end 101 | end 102 | 103 | -- 损害 104 | function Ship:hurt() 105 | if (self.canBeAttack) then 106 | self._hurtColorLife = 2 107 | self.HP = self.HP - 1 108 | end 109 | end 110 | 111 | -- 碰撞矩形 112 | function Ship:collideRect(x, y) 113 | local a = self:getContentSize() 114 | return cc.rect(x - a.width / 2, y - a.height / 2, a.width, a.height / 2) 115 | end 116 | 117 | function Ship:initBornSprite() 118 | self.bornSprite = display.newSprite("#ship03.png") 119 | local blendFunc = ccBlendFunc:new() 120 | blendFunc.src = GL_SRC_ALPHA 121 | blendFunc.dst = GL_ONE 122 | self.bornSprite:setBlendFunc(blendFunc) 123 | self.bornSprite:setPosition(self:getContentSize().width / 2, 12) 124 | self.bornSprite:setVisible(false) 125 | self:addChild(self.bornSprite, 3000, 99999) 126 | end 127 | 128 | function Ship:born() 129 | -- revive effect 130 | self.canBeAttack = false 131 | self.bornSprite:setScale(8) 132 | self.bornSprite:runAction(cc.ScaleTo:create(0.5, 1, 1)) 133 | self.bornSprite:setVisible(true) 134 | local blinks = cc.Blink:create(3, 9) 135 | local makeBeAttack = cc.CallFuncN:create(function(t) 136 | t.canBeAttack = true 137 | t:setVisible(true) 138 | t.bornSprite:setVisible(false) 139 | end) 140 | local array = CCArray:create() 141 | array:addObject(cc.DelayTime:create(0.5)) 142 | array:addObject(blinks) 143 | array:addObject(makeBeAttack) 144 | self:runAction(cc.Sequence:create(array)) 145 | 146 | self.HP = 5 147 | self._hurtColorLife = 0 148 | self.active = true 149 | end 150 | 151 | return Ship -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/SparkEffect.lua: -------------------------------------------------------------------------------- 1 | -- 火花物效 2 | local SparkEffect = class("SparkEffect") 3 | 4 | -- 构造函数 5 | function SparkEffect:ctor() 6 | self.active = true 7 | self.scale = 1.2 8 | self.duration = 0.7 9 | 10 | -- 爆炸图片一 11 | self.spark1 = display.newSprite("#explode2.png") 12 | local blendFunc = ccBlendFunc:new() 13 | blendFunc.src = GL_SRC_ALPHA 14 | blendFunc.dst = GL_ONE 15 | self.spark1:setBlendFunc(blendFunc) 16 | 17 | -- 爆炸图片二 18 | self.spark2 = display.newSprite("#explode3.png") 19 | local blendFunc = ccBlendFunc:new() 20 | blendFunc.src = GL_SRC_ALPHA 21 | blendFunc.dst = GL_ONE 22 | self.spark2:setBlendFunc(blendFunc) 23 | end 24 | 25 | function SparkEffect:reset(x, y) 26 | self.spark1:setPosition(cc.p(x, y)) 27 | self.spark2:setPosition(cc.p(x, y)) 28 | 29 | self.spark1:setScale(self.scale) 30 | self.spark2:setScale(self.scale) 31 | self.spark2:setRotation(math.random() * 360) 32 | 33 | local right = cc.RotateBy:create(self.duration, 45) 34 | local scaleBy = cc.ScaleBy:create(self.duration, 3, 3) 35 | local array = CCArray:create() 36 | array:addObject(cc.FadeOut:create(self.duration)) 37 | array:addObject(cc.CallFunc:create(handler(self, self.destroy))) 38 | local seq = cc.Sequence:create(array) 39 | 40 | self.spark1:runAction(right) 41 | self.spark1:runAction(scaleBy) 42 | self.spark1:runAction(seq) 43 | 44 | self.spark2:runAction(clone(scaleBy)) 45 | self.spark2:runAction(clone(seq)) 46 | end 47 | 48 | function SparkEffect:destroy() 49 | self.active = false 50 | self.spark1:setVisible(false) 51 | self.spark2:setVisible(false) 52 | self.spark1:stopAllActions() 53 | self.spark2:stopAllActions() 54 | end 55 | 56 | function SparkEffect.getOrCreateSparkEffect(x, y) 57 | local selChild = nil 58 | for i = 1, #MW.CONTAINER.SPARKS do 59 | selChild = MW.CONTAINER.SPARKS[i] 60 | if (selChild.active == false) then 61 | selChild.active = true 62 | selChild.spark1:setVisible(true) 63 | selChild.spark2:setVisible(true) 64 | selChild:reset(x, y) 65 | return selChild 66 | end 67 | end 68 | local spark = SparkEffect.create() 69 | spark:reset(x, y) 70 | return spark 71 | end 72 | 73 | function SparkEffect.create() 74 | local sparkEffect = SparkEffect.new() 75 | g_sharedGameLayer:addSpark(sparkEffect.spark1) 76 | g_sharedGameLayer:addSpark(sparkEffect.spark2) 77 | table.insert(MW.CONTAINER.SPARKS, sparkEffect) 78 | return sparkEffect 79 | end 80 | 81 | function SparkEffect.preSet() 82 | local sparkEffect = nil 83 | for i = 1, 6 do 84 | sparkEffect = SparkEffect.create() 85 | sparkEffect.active = false 86 | sparkEffect.spark1:setVisible(false) 87 | sparkEffect.spark2:setVisible(false) 88 | end 89 | end 90 | 91 | return SparkEffect -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/app/MyApp.lua: -------------------------------------------------------------------------------- 1 | 2 | require("config") 3 | require("framework.init") 4 | 5 | local MyApp = class("MyApp", cc.mvc.AppBase) 6 | 7 | function MyApp:ctor() 8 | MyApp.super.ctor(self) 9 | end 10 | 11 | function MyApp:run() 12 | CCFileUtils:sharedFileUtils():addSearchPath("res/") 13 | CCFileUtils:sharedFileUtils():addSearchPath("res/ImageRaw/") 14 | CCFileUtils:sharedFileUtils():addSearchPath("res/Music/") 15 | self:enterScene("SysMenuScene") 16 | end 17 | 18 | return MyApp 19 | -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/app/scenes/AboutScene.lua: -------------------------------------------------------------------------------- 1 | -- 关于场景 2 | local AboutScene = class("AboutScene", function() 3 | return display.newScene("AboutScene") 4 | end) 5 | 6 | -- 构造函数 7 | function AboutScene:ctor() 8 | self:init() 9 | end 10 | 11 | -- 初始化函数 12 | function AboutScene:init() 13 | local bRet = false 14 | 15 | -- 背景图片 16 | local bg = display.newSprite(res.loading_png) 17 | bg:setAnchorPoint(0,0) 18 | local size = bg:getContentSize() 19 | bg:setScaleY(display.height/size.height) 20 | self:addChild(bg, 0, 1) 21 | 22 | -- "About"标题图片 23 | local title = cc.Sprite:create(res.menuTitle_png, cc.rect(0, 36, 100, 34)) 24 | title:setPosition(display.cx, display.height - 60) 25 | self:addChild(title) 26 | 27 | local text = [[ 28 | This showcase utilizes many features from Cocos2d-html5 engine, including: Parallax background, tilemap, actions, ease, frame animation, schedule, Labels, keyboard Dispatcher, Scene Transition. 29 | Art and audio is copyrighted by Enigmata Genus Revenge, you may not use any copyrigted material without permission. This showcase is licensed under GPL. 30 | 31 | Cocos2d-html5版: 32 | Shengxiang Chen (陈升想) 33 | Dingping Lv (吕定平) 34 | Effects animation: Hao Wu(吴昊) 35 | Quality Assurance: Sean Lin(林顺) 36 | 37 | Quick-Cocos2d-x移植版: 38 | ZYM (倚天) QQ:43156150 39 | 40 | 源代码下载地址: 41 | https://github.com/zym2014/MoonWarriors-lua 42 | ]] 43 | 44 | -- There is a bug in LabelTTF native. Apparently it fails with some unicode chars. 45 | local about = ui.newTTFLabel({text = text, font = "Arial", 46 | size = 14, align = ui.TEXT_ALIGN_LEFT, 47 | dimensions = cc.size(display.width * 0.90, 0) 48 | }) 49 | about:setPosition(display.cx, display.cy - 20) 50 | about:setAnchorPoint(0.5, 0.5) 51 | self:addChild(about) 52 | 53 | -- "Go back"菜单按钮 54 | local back = ui.newTTFLabelMenuItem({ 55 | text = "Go back", 56 | font = "Arial", 57 | size = 14, 58 | aligh = ui.TEXT_ALIGN_CENTER, 59 | listener = self.onBackCallback, 60 | -- x = display.cx, 61 | -- y = 40, 62 | tag = 2 63 | }) 64 | local menu = ui.newMenu({back}) 65 | menu:setPosition(display.cx, 40) 66 | self:addChild(menu) 67 | 68 | bRet = true 69 | 70 | return bRet 71 | end 72 | 73 | -- "Go Back"菜单按钮 74 | function AboutScene:onBackCallback(pSender) 75 | app:enterScene("SysMenuScene", nil, "fade", 1.2) 76 | end 77 | 78 | return AboutScene -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/app/scenes/GameOverScene.lua: -------------------------------------------------------------------------------- 1 | -- 游戏结束场景 2 | local GameOverScene = class("GameOverScene", function() 3 | return display.newScene("GameOverScene") 4 | end) 5 | 6 | -- 构造函数 7 | function GameOverScene:ctor() 8 | local bRet = false 9 | 10 | -- 背景图片 11 | local bg = display.newSprite(res.loading_png) 12 | bg:setAnchorPoint(0, 0) 13 | local size = bg:getContentSize() 14 | bg:setScaleY(display.height/size.height) 15 | self:addChild(bg, 0, 1) 16 | 17 | -- 闪光图片 18 | local flare = display.newSprite(res.flare_jpg) 19 | self:addChild(flare) 20 | flare:setVisible(false) 21 | 22 | -- "Game Over"图片 23 | local logo = display.newSprite(res.gameOver_png) 24 | logo:setAnchorPoint(0, 0) 25 | logo:setPosition(0, display.height-180) 26 | self:addChild(logo, 10, 1) 27 | 28 | -- "Your Score"文本标签 29 | local lbScore = ui.newTTFLabel({text = "Your Score:" .. MW.SCORE, 30 | font = "Arial Bold", size = 16}) 31 | lbScore:setPosition(160, display.height-200) 32 | lbScore:setColor(cc.c3b(250, 179, 0)) 33 | self:addChild(lbScore, 10) 34 | 35 | -- "Play Again"菜单按钮 36 | local playAgainNormal = cc.Sprite:create(res.menu_png, cc.rect(378, 0, 126, 33)) 37 | local playAgainSelected = cc.Sprite:create(res.menu_png, cc.rect(378, 33, 126, 33)) 38 | local playAgainDisabled = cc.Sprite:create(res.menu_png, cc.rect(378, 33 * 2, 126, 33)) 39 | 40 | local playAgain = ui.newImageMenuItem({ 41 | image = playAgainNormal, 42 | imageSelected = playAgainSelected, 43 | imageDisabled = playAgainDisabled, 44 | listener = function() 45 | flareEffect(flare, self, handler(self, self.onPlayAgain)) 46 | end 47 | }) 48 | 49 | local menu = ui.newMenu({playAgain}) 50 | menu:setPosition(display.cx, display.height-260) 51 | self:addChild(menu, 1, 2) 52 | 53 | -- "Cocos2d-x"图片 54 | local cocos2dhtml5 = display.newSprite(res.cocos2d_html5_png) 55 | cocos2dhtml5:setPosition(160, display.height-330) 56 | self:addChild(cocos2dhtml5, 10) 57 | 58 | -- "Download Cocos2d-html5"菜单按钮 59 | local menu1 = ui.newTTFLabelMenuItem({ 60 | text = "Download Cocos2d-html5", 61 | font = "Arial", 62 | size = 14, 63 | aligh = ui.TEXT_ALIGN_CENTER, 64 | -- listener = self.onBackCallback 65 | }) 66 | 67 | -- "Download This Sample"菜单按钮 68 | local menu2 = ui.newTTFLabelMenuItem({ 69 | text = "Download This Sample", 70 | font = "Arial", 71 | size = 14, 72 | aligh = ui.TEXT_ALIGN_CENTER, 73 | -- listener = self.onBackCallback 74 | }) 75 | 76 | local menu = ui.newMenu({menu1, menu2}) 77 | menu:alignItemsVerticallyWithPadding(10) 78 | menu:setPosition(160, display.height-400) 79 | self:addChild(menu) 80 | 81 | -- 播放背景音乐 82 | if MW.SOUND then 83 | audio.playMusic(res.mainMainMusic_mp3) 84 | end 85 | 86 | bRet = true 87 | 88 | return bRet 89 | end 90 | 91 | -- "Play Again"菜单按钮 92 | function GameOverScene:onPlayAgain(pSender) 93 | app:enterScene("MainScene", nil, "fade", 1.2) 94 | end 95 | 96 | return GameOverScene -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/app/scenes/MainScene.lua: -------------------------------------------------------------------------------- 1 | local LevelManager = require("LevelManager") 2 | local Ship = require("Ship") 3 | local Explosion = require("Explosion") 4 | local Bullet = require("Bullet") 5 | local Enemy = require("Enemy") 6 | local HitEffect = require("HitEffect") 7 | local SparkEffect = require("SparkEffect") 8 | local Bg = require("Background") 9 | local BackSky = Bg.BackSky 10 | local BackTileMap = Bg.BackTileMap 11 | 12 | STATE_PLAYING = 0 13 | STATE_GAMEOVER = 1 14 | MAX_CONTAINT_WIDTH = 40 15 | MAX_CONTAINT_HEIGHT = 40 16 | 17 | g_sharedGameLayer = nil 18 | 19 | -- 主场景 20 | local MainScene = class("MainScene", function() 21 | return display.newScene("MainScene") 22 | end) 23 | 24 | -- 构造函数 25 | function MainScene:ctor() 26 | self._time = 0 27 | self._ship = nil 28 | self._backSky = nil 29 | self._backSkyHeight = 0 30 | self._backSkyRe = nil 31 | self._levelManager = nil 32 | self._tmpScore = 0 33 | self._isBackSkyReload = false 34 | self._isBackTileReload = false 35 | self.lbScore = nil 36 | self.screenRect = nil 37 | self.explosionAnimation = {} 38 | self._beginPos = cc.p(0, 0) 39 | self._state = STATE_PLAYING 40 | self._explosions = nil 41 | self._texOpaqueBatch = nil 42 | self._texTransparentBatch = nil 43 | 44 | self:init() 45 | end 46 | 47 | function MainScene:onEnter() 48 | end 49 | 50 | function MainScene:onExit() 51 | end 52 | 53 | -- 初始化函数 54 | function MainScene:init() 55 | local bRet = false 56 | 57 | -- reset global values 58 | MW.CONTAINER.ENEMIES = {} 59 | MW.CONTAINER.ENEMY_BULLETS = {} 60 | MW.CONTAINER.PLAYER_BULLETS = {} 61 | MW.CONTAINER.EXPLOSIONS = {} 62 | MW.CONTAINER.SPARKS = {} 63 | MW.CONTAINER.HITS = {} 64 | MW.CONTAINER.BACKSKYS = {} 65 | MW.CONTAINER.BACKTILEMAPS = {} 66 | MW.ACTIVE_ENEMIES = 0 67 | 68 | MW.SCORE = 0 69 | MW.LIFE = 4 70 | self._state = STATE_PLAYING 71 | 72 | -- 加载纹理图片 73 | display.addSpriteFramesWithFile(res.textureOpaquePack_plist, res.textureOpaquePack_png) 74 | display.addSpriteFramesWithFile(res.textureTransparentPack_plist, res.textureTransparentPack_png) 75 | display.addSpriteFramesWithFile(res.explosion_plist, res.explosion_png) 76 | display.addSpriteFramesWithFile(res.b01_plist, res.b01_png) 77 | 78 | -- create touch layer 79 | self.layer = display.newLayer() 80 | self.layer:addNodeEventListener(cc.NODE_TOUCH_EVENT, handler(self, self.onTouch)) 81 | self:addChild(self.layer) 82 | 83 | self.layer:setTouchEnabled(true) 84 | 85 | -- OpaqueBatch 86 | self._texOpaqueBatch = display.newBatchNode(res.textureOpaquePack_png) 87 | local blendFunc = ccBlendFunc:new() 88 | blendFunc.src = GL_SRC_ALPHA 89 | blendFunc.dst = GL_ONE 90 | self._texOpaqueBatch:setBlendFunc(blendFunc) 91 | self:addChild(self._texOpaqueBatch) 92 | 93 | -- TransparentBatch 94 | self._texTransparentBatch = display.newBatchNode(res.textureTransparentPack_png) 95 | self:addChild(self._texTransparentBatch) 96 | 97 | self._levelManager = LevelManager.new(self) 98 | 99 | self.screenRect = cc.rect(0, 0, display.width, display.height + 10) 100 | 101 | -- score 102 | self.lbScore = cc.LabelBMFont:create("Score: 0", res.arial_14_fnt) 103 | self.lbScore:setAnchorPoint(1, 0) 104 | self.lbScore:setAlignment(ui.TEXT_ALIGN_RIGHT) 105 | self:addChild(self.lbScore, 1000) 106 | self.lbScore:setPosition(display.width - 5, display.height - 30) 107 | 108 | -- ship life 109 | local life = display.newSprite("#ship01.png") 110 | life:setScale(0.6) 111 | life:setPosition(30, display.height - 22) 112 | self._texTransparentBatch:addChild(life, 1, 5) 113 | 114 | -- ship Life count 115 | self._lbLife = cc.LabelTTF:create("0", "Arial", 20) 116 | self._lbLife:setPosition(60, display.height - 22) 117 | self._lbLife:setColor(cc.c3b(255, 0, 0)) 118 | self:addChild(self._lbLife, 1000) 119 | 120 | -- ship 121 | self._ship = Ship.new() 122 | self._texTransparentBatch:addChild(self._ship, self._ship.zOrder, MW.UNIT_TAG.PLAYER) 123 | 124 | -- explosion batch node 125 | self._explosions = display.newBatchNode(res.explosion_png) 126 | local blendFunc = ccBlendFunc:new() 127 | blendFunc.src = GL_SRC_ALPHA 128 | blendFunc.dst = GL_ONE 129 | self._explosions:setBlendFunc(blendFunc) 130 | self:addChild(self._explosions) 131 | Explosion.sharedExplosion() 132 | 133 | -- accept touch now! 134 | 135 | -- if (sys.capabilities.hasOwnProperty('keyboard')) then 136 | -- self:setKeyboardEnabled(true) 137 | -- end 138 | 139 | -- if (sys.capabilities.hasOwnProperty('mouse')) then 140 | -- -- if ('mouse' in sys.capabilities) 141 | -- self:setMouseEnabled(true) 142 | -- end 143 | 144 | -- if (sys.capabilities.hasOwnProperty('touches')) then 145 | -- -- if ('touches' in sys.capabilities) 146 | -- self:setTouchEnabled(true) 147 | -- end 148 | 149 | -- schedule 150 | self:addNodeEventListener(cc.NODE_ENTER_FRAME_EVENT, handler(self, self.update)) 151 | self:scheduleUpdate() 152 | self:schedule(handler(self, self.scoreCounter), 1) 153 | 154 | if (MW.SOUND) then 155 | audio.playMusic(res.bgMusic_mp3, true) 156 | end 157 | 158 | bRet = true 159 | 160 | g_sharedGameLayer = self 161 | 162 | -- pre set 163 | Bullet.preSet() 164 | Enemy.preSet() 165 | HitEffect.preSet() 166 | SparkEffect.preSet() 167 | Explosion.preSet() 168 | BackSky.preSet() 169 | BackTileMap.preSet() 170 | 171 | self:initBackground() 172 | 173 | -- "Main Menu"菜单按钮 174 | local sysMenu = ui.newTTFLabelMenuItem({ 175 | text = "Main Menu", 176 | font = "Arial", 177 | size = 18, 178 | listener = handler(self, self.onSysMenu) 179 | }) 180 | 181 | local menu = ui.newMenu({sysMenu}) 182 | menu:setPosition(0, 0) 183 | sysMenu:setAnchorPoint(0, 0) 184 | sysMenu:setPosition(display.width-95, 5) 185 | self:addChild(menu, 1, 2) 186 | 187 | return bRet 188 | end 189 | 190 | function MainScene:onSysMenu(pSender) 191 | app:enterScene("SysMenuScene", nil, "fade", 1.2) 192 | end 193 | 194 | function MainScene:scoreCounter() 195 | if self._state == STATE_PLAYING then 196 | self._time = self._time + 1 197 | self._levelManager:loadLevelResource(self._time) 198 | end 199 | end 200 | 201 | function MainScene:onTouchesMoved(touches, event) 202 | self:processEvent(touches[0]) 203 | end 204 | 205 | function MainScene:onMouseDragged(event) 206 | self:processEvent(event) 207 | end 208 | 209 | function MainScene:onTouch(event) 210 | if (event.name == "moved" or event.name == "dragged") then 211 | if self._state == STATE_PLAYING then 212 | local delta = cc.PointSub(cc.p(event.x, event.y), cc.p(event.prevX, event.prevY)) 213 | local x, y = self._ship:getPosition() 214 | local curPos = cc.p(x, y) 215 | curPos = cc.PointAdd(curPos, delta) 216 | curPos = cc.PointClamp(curPos, cc.p(0, 0), cc.p(display.width, display.height)) 217 | self._ship:setPosition(curPos) 218 | end 219 | end 220 | return true 221 | end 222 | 223 | function MainScene:onKeyDown(e) 224 | MW.KEYS[e] = true 225 | end 226 | 227 | function MainScene:onKeyUp(e) 228 | MW.KEYS[e] = false 229 | end 230 | 231 | function MainScene:update(dt) 232 | if (self._state == STATE_PLAYING) then 233 | self:checkIsCollide() 234 | self:removeInactiveUnit(dt) 235 | self:checkIsReborn() 236 | self:updateUI() 237 | self:_movingBackground(dt) 238 | end 239 | end 240 | 241 | -- 检测是否碰撞 242 | function MainScene:checkIsCollide() 243 | local selChild, bulletChild 244 | -- check collide 245 | local locShip = self._ship 246 | for i = 1, #MW.CONTAINER.ENEMIES do 247 | selChild = MW.CONTAINER.ENEMIES[i] 248 | if selChild.active then 249 | for j = 1, #MW.CONTAINER.PLAYER_BULLETS do 250 | bulletChild = MW.CONTAINER.PLAYER_BULLETS[j] 251 | if (bulletChild.active and self:collide(selChild, bulletChild)) then 252 | bulletChild:hurt() 253 | selChild:hurt() 254 | end 255 | end 256 | if (self:collide(selChild, locShip)) then 257 | if (locShip.active) then 258 | selChild:hurt() 259 | locShip:hurt() 260 | end 261 | end 262 | end 263 | end 264 | 265 | for i = 1, #MW.CONTAINER.ENEMY_BULLETS do 266 | selChild = MW.CONTAINER.ENEMY_BULLETS[i] 267 | if (selChild.active and self:collide(selChild, locShip)) then 268 | if (locShip.active) then 269 | selChild:hurt() 270 | locShip:hurt() 271 | end 272 | end 273 | end 274 | end 275 | 276 | -- 移除不活动个体 277 | function MainScene:removeInactiveUnit(dt) 278 | local selChild 279 | local children = self._texOpaqueBatch:getChildren() 280 | for i = 0, children:count()-1 do 281 | selChild = children:objectAtIndex(i) 282 | if (selChild and selChild.active) then 283 | selChild:update(dt) 284 | end 285 | end 286 | 287 | children = self._texTransparentBatch:getChildren() 288 | for i = 0, children:count()-1 do 289 | selChild = children:objectAtIndex(i) 290 | if (selChild and selChild.active) then 291 | selChild:update(dt) 292 | end 293 | end 294 | end 295 | 296 | function MainScene:checkIsReborn() 297 | local locShip = self._ship 298 | if (MW.LIFE > 0 and (not locShip.active)) then 299 | locShip:born() 300 | elseif (MW.LIFE <= 0 and (not locShip.active)) then 301 | self._state = STATE_GAMEOVER 302 | -- XXX: needed for JS bindings. 303 | self._ship = nil 304 | local array = CCArray:create() 305 | array:addObject(cc.DelayTime:create(0.2)) 306 | array:addObject(cc.CallFuncN:create(handler(self, self.onGameOver))) 307 | self:runAction(cc.Sequence:create(array)) 308 | end 309 | end 310 | 311 | function MainScene:updateUI() 312 | if (self._tmpScore < MW.SCORE) then 313 | self._tmpScore = self._tmpScore + 1 314 | end 315 | self._lbLife:setString(MW.LIFE .. '') 316 | self.lbScore:setString("Score: " .. self._tmpScore) 317 | end 318 | 319 | function MainScene:collide(a, b) 320 | local x1, y1 = a:getPosition() 321 | local x2, y2 = b:getPosition() 322 | if (math.abs(x1 - x2) > MAX_CONTAINT_WIDTH or math.abs(y1 - y2) > MAX_CONTAINT_HEIGHT) then 323 | return false 324 | end 325 | 326 | local aRect = a:collideRect(x1, y1) 327 | local bRect = b:collideRect(x2, y2) 328 | return cc.rectIntersectsRect(aRect, bRect) 329 | end 330 | 331 | function MainScene:initBackground() 332 | self._backSky = BackSky.getOrCreate() 333 | self._backSkyHeight = self._backSky:getContentSize().height; 334 | 335 | self:moveTileMap() 336 | self:schedule(handler(self, self.moveTileMap), 5) 337 | end 338 | 339 | function MainScene:moveTileMap() 340 | local backTileMap = BackTileMap.getOrCreate() 341 | local ran = math.random() 342 | backTileMap:setPosition(ran * 320, display.height) 343 | local move = cc.MoveBy:create(ran * 2 + 10, cc.p(0, -display.height-240)) 344 | local fun = cc.CallFunc:create(function() 345 | backTileMap:destroy() 346 | end) 347 | local array = CCArray:create() 348 | array:addObject(move) 349 | array:addObject(fun) 350 | backTileMap:runAction(cc.Sequence:create(array)) 351 | end 352 | 353 | function MainScene:_movingBackground(dt) 354 | local movingDist = 16 * dt -- background's moving rate is 16 pixel per second 355 | 356 | local locSkyHeight = self._backSkyHeight 357 | local locBackSky = self._backSky 358 | local currPosY = locBackSky:getPositionY() - movingDist 359 | local locBackSkyRe = self._backSkyRe 360 | 361 | if (locSkyHeight + currPosY <= display.height) then 362 | if (locBackSkyRe ~= nil) then 363 | error("The memory is leaking at moving background") 364 | end 365 | 366 | locBackSkyRe = self._backSky 367 | self._backSkyRe = self._backSky 368 | 369 | -- create a new background 370 | self._backSky = BackSky.getOrCreate() 371 | locBackSky = self._backSky 372 | locBackSky:setPositionY(currPosY + locSkyHeight - 2) 373 | else 374 | locBackSky:setPositionY(currPosY) 375 | 376 | if (locBackSkyRe) then 377 | -- locBackSkyRe 378 | currPosY = locBackSkyRe:getPositionY() - movingDist 379 | if (currPosY + locSkyHeight < 0) then 380 | locBackSkyRe:destroy() 381 | self._backSkyRe = nil 382 | else 383 | locBackSkyRe:setPositionY(currPosY) 384 | end 385 | end 386 | end 387 | end 388 | 389 | function MainScene:onGameOver() 390 | app:enterScene("GameOverScene", nil, "fade", 1.2) 391 | end 392 | 393 | function MainScene:addEnemy(enemy, z, tag) 394 | self._texTransparentBatch:addChild(enemy, z, tag) 395 | end 396 | 397 | function MainScene:addExplosions(explosion) 398 | self._explosions:addChild(explosion) 399 | end 400 | 401 | function MainScene:addBulletHits(hit, zOrder) 402 | self._texOpaqueBatch:addChild(hit, zOrder) 403 | end 404 | 405 | function MainScene:addSpark(spark) 406 | self._texOpaqueBatch:addChild(spark) 407 | end 408 | 409 | function MainScene:addBullet(bullet, zOrder, mode) 410 | self._texOpaqueBatch:addChild(bullet, zOrder, mode) 411 | end 412 | 413 | return MainScene 414 | -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/app/scenes/SettingsScene.lua: -------------------------------------------------------------------------------- 1 | -- 设置场景 2 | local SettingsScene = class("SettingsScene", function() 3 | return display.newScene("SettingsScene") 4 | end) 5 | 6 | -- 构造函数 7 | function SettingsScene:ctor() 8 | self:init() 9 | end 10 | 11 | -- 初始化函数 12 | function SettingsScene:init() 13 | local bRet = false 14 | 15 | -- 背景图片 16 | local bg = display.newSprite(res.loading_png) 17 | bg:setAnchorPoint(0, 0) 18 | size = bg:getContentSize() 19 | bg:setScaleY(display.height/size.height) 20 | self:addChild(bg, 0, 1) 21 | 22 | -- "Option"标题图片 23 | local title = cc.Sprite:create(res.menuTitle_png, cc.rect(0, 0, 134, 34)) 24 | title:setPosition(display.cx, display.height - 120) 25 | self:addChild(title) 26 | 27 | -- "Sound"菜单文本 28 | cc.MenuItemFont:setFontName("Arial") 29 | cc.MenuItemFont:setFontSize(18) 30 | local title1 = cc.MenuItemFont:create("Sound") 31 | title1:setEnabled(false) 32 | 33 | -- "On/Off"菜单按钮 34 | cc.MenuItemFont:setFontName("Arial") 35 | cc.MenuItemFont:setFontSize(26) 36 | local item1 = cc.MenuItemToggle:create() 37 | item1:addSubItem(cc.MenuItemFont:create("On")) 38 | item1:addSubItem(cc.MenuItemFont:create("Off")) 39 | item1:addNodeEventListener(cc.MENU_ITEM_CLICKED_EVENT, function(tag) 40 | self:onSoundControl(tag) 41 | end) 42 | local state = (MW.SOUND and 0) or 1 -- var state = MW.SOUND ? 0 : 1; 43 | item1:setSelectedIndex(state) 44 | 45 | -- "Mode"菜单文本 46 | cc.MenuItemFont:setFontName("Arial") 47 | cc.MenuItemFont:setFontSize(18) 48 | local title2 = cc.MenuItemFont:create("Mode") 49 | title2:setEnabled(false) 50 | 51 | -- "Easy/Normal/Hard"菜单按钮 52 | cc.MenuItemFont:setFontName("Arial") 53 | cc.MenuItemFont:setFontSize(26) 54 | local item2 = cc.MenuItemToggle:create() 55 | item2:addSubItem(cc.MenuItemFont:create("Easy")) 56 | item2:addSubItem(cc.MenuItemFont:create("Normal")) 57 | item2:addSubItem(cc.MenuItemFont:create("Hard")) 58 | item2:addNodeEventListener(cc.MENU_ITEM_CLICKED_EVENT, function(tag) 59 | self:onModeControl(tag) 60 | end) 61 | item2:setSelectedIndex(0) 62 | 63 | -- "Go back"菜单按钮 64 | local back = ui.newTTFLabelMenuItem({ 65 | text = "Go back", 66 | font = "Arial", 67 | size = 20, 68 | aligh = ui.TEXT_ALIGN_CENTER, 69 | listener = self.onBackCallback, 70 | -- x = display.cx, 71 | -- y = 40, 72 | tag = 2 73 | }) 74 | back:setScale(0.8) 75 | 76 | local menu = ui.newMenu({title1, title2, item1, item2, back}) 77 | local arrCols = CCArray:create() 78 | arrCols:addObject(CCInteger:create(2)) 79 | arrCols:addObject(CCInteger:create(2)) 80 | arrCols:addObject(CCInteger:create(1)) 81 | menu:alignItemsInColumnsWithArray(arrCols) 82 | arrCols:removeAllObjects() 83 | menu:setPosition(display.cx, display.cy) 84 | self:addChild(menu) 85 | 86 | back:setPositionY(back:getPositionY() - 50) 87 | 88 | bRet = true 89 | 90 | return bRet 91 | end 92 | 93 | -- "Go back"菜单按钮 94 | function SettingsScene:onBackCallback(pSender) 95 | app:enterScene("SysMenuScene", nil, "fade", 1.2) 96 | end 97 | 98 | -- "On/Off"菜单按钮 99 | function SettingsScene:onSoundControl() 100 | MW.SOUND = not MW.SOUND 101 | if MW.SOUND then 102 | audio.playMusic(res.mainMainMusic_mp3) 103 | else 104 | audio.stopMusic() 105 | end 106 | end 107 | 108 | -- "Easy/Normal/Hard"菜单按钮 109 | function SettingsScene:onModeControl() 110 | 111 | end 112 | 113 | return SettingsScene 114 | -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/app/scenes/SysMenuScene.lua: -------------------------------------------------------------------------------- 1 | require("config.GameConfig") 2 | require("Effect") 3 | 4 | -- 系统菜单场景(New Game、Option、About) 5 | local SysMenuScene = class("SysMenuScene", function() 6 | return display.newScene("SysMenuScene") 7 | end) 8 | 9 | -- 构造函数 10 | function SysMenuScene:ctor() 11 | self:init() 12 | end 13 | 14 | function SysMenuScene:onEnter() 15 | end 16 | 17 | function SysMenuScene:onExit() 18 | end 19 | 20 | -- 初始化函数 21 | function SysMenuScene:init() 22 | local bRet = false 23 | 24 | display.addSpriteFramesWithFile(res.textureTransparentPack_plist, res.textureTransparentPack_png) 25 | 26 | -- 背景图片 27 | local bg = display.newSprite(res.loading_png) 28 | bg:setAnchorPoint(0, 0) 29 | local size = bg:getContentSize() 30 | bg:setScaleY(display.height/size.height) 31 | self:addChild(bg, 0, 1) 32 | 33 | -- Logo图片 34 | self.logo = display.newSprite(res.logo_png, 0, display.height-230) 35 | self.logo:setAnchorPoint(0, 0) 36 | self:addChild(self.logo, 10, 1) 37 | 38 | local newGameNormal = cc.Sprite:create(res.menu_png, cc.rect(0, 0, 126, 33)) 39 | local newGameSelected = cc.Sprite:create(res.menu_png, cc.rect(0, 33, 126, 33)) 40 | local newGameDisabled = cc.Sprite:create(res.menu_png, cc.rect(0, 33 * 2, 126, 33)) 41 | 42 | local gameSettingsNormal = cc.Sprite:create(res.menu_png, cc.rect(126, 0, 126, 33)) 43 | local gameSettingsSelected = cc.Sprite:create(res.menu_png, cc.rect(126, 33, 126, 33)) 44 | local gameSettingsDisabled = cc.Sprite:create(res.menu_png, cc.rect(126, 33 * 2, 126, 33)) 45 | 46 | local aboutNormal = cc.Sprite:create(res.menu_png, cc.rect(252, 0, 126, 33)) 47 | local aboutSelected = cc.Sprite:create(res.menu_png, cc.rect(252, 33, 126, 33)) 48 | local aboutDisabled = cc.Sprite:create(res.menu_png, cc.rect(252, 33 * 2, 126, 33)) 49 | 50 | local flare = cc.Sprite:create(res.flare_jpg) 51 | flare:setVisible(false) 52 | self:addChild(flare) 53 | 54 | local newGame = ui.newImageMenuItem({ 55 | image = newGameNormal, 56 | imageSelected = newGameSelected, 57 | imageDisabled = newGameDisabled, 58 | listener = function() 59 | self:onButtonEffect() 60 | -- self:onNewGame() 61 | flareEffect(flare, self, handler(self, self.onNewGame)) 62 | end 63 | }) 64 | 65 | local gameSettings = ui.newImageMenuItem({ 66 | image = gameSettingsNormal, 67 | imageSelected = gameSettingsSelected, 68 | imageDisabled = gameSettingsDisabled, 69 | listener = handler(self, self.onSettings) 70 | }) 71 | 72 | local about = ui.newImageMenuItem({ 73 | image = aboutNormal, 74 | imageSelected = aboutSelected, 75 | imageDisabled = aboutDisabled, 76 | listener = handler(self, self.onAbout) 77 | }) 78 | 79 | local menu = ui.newMenu({newGame, gameSettings, about}) 80 | menu:alignItemsVerticallyWithPadding(10); 81 | menu:setPosition(display.cx, display.cy - 80) 82 | self:addChild(menu, 1, 2) 83 | 84 | self:schedule(handler(self, self.update), 0.1) 85 | 86 | self._ship = display.newSprite("#ship01.png") 87 | self._ship:setAnchorPoint(0, 0) 88 | local pos = cc.p(math.random() * display.width, 0) 89 | self._ship:setPosition(pos) 90 | self:addChild(self._ship, 0, 4) 91 | 92 | self._ship:runAction(cc.MoveBy:create(2, cc.p(math.random() * display.width, pos.y + display.height + 100))) 93 | 94 | if MW.SOUND then 95 | audio.setMusicVolume(0.7) 96 | audio.playMusic(res.mainMainMusic_mp3, true) 97 | end 98 | 99 | bRet = true 100 | 101 | return bRet 102 | end 103 | 104 | -- New Game菜单按钮 105 | function SysMenuScene:onNewGame(pSender) 106 | app:enterScene("MainScene", nil, "fade", 1.2) 107 | -- load resources 108 | -- cc.LoaderScene.preload(g_maingame, function () { 109 | -- var scene = cc.Scene.create() 110 | -- scene.addChild(GameLayer.create()); 111 | -- scene.addChild(GameControlMenu.create()); 112 | -- cc.Director.getInstance().replaceScene(cc.TransitionFade.create(1.2, scene)); 113 | -- }, this); 114 | -- } 115 | end 116 | 117 | -- Option菜单按钮 118 | function SysMenuScene:onSettings(pSender) 119 | self.onButtonEffect() 120 | app:enterScene("SettingsScene", nil, "fade", 1.2) 121 | end 122 | 123 | -- About菜单按钮 124 | function SysMenuScene:onAbout(pSender) 125 | self.onButtonEffect() 126 | app:enterScene("AboutScene", nil, "fade", 1.2) 127 | end 128 | 129 | -- 帧事件 130 | function SysMenuScene:update() 131 | if self._ship:getPositionY() > 480 then 132 | local pos = cc.p(math.random() * display.width, 10) 133 | self._ship:setPosition(pos) 134 | self._ship:runAction(cc.MoveBy:create( 135 | 5 * math.random(), 136 | cc.p(math.random() * display.width, pos.y + 480))) 137 | end 138 | end 139 | 140 | -- 播放点击菜单按钮音效 141 | function SysMenuScene:onButtonEffect() 142 | if MW.SOUND then 143 | audio.playSound(res.buttonEffet_mp3) 144 | end 145 | end 146 | 147 | return SysMenuScene 148 | -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/config.lua: -------------------------------------------------------------------------------- 1 | 2 | -- 0 - disable debug info, 1 - less debug info, 2 - verbose debug info 3 | DEBUG = 1 4 | 5 | -- display FPS stats on screen 6 | DEBUG_FPS = true 7 | 8 | -- dump memory info every 10 seconds 9 | DEBUG_MEM = false 10 | 11 | -- load deprecated API 12 | LOAD_DEPRECATED_API = false 13 | 14 | -- load shortcodes API 15 | LOAD_SHORTCODES_API = true 16 | 17 | -- screen orientation 18 | CONFIG_SCREEN_ORIENTATION = "portrait" 19 | 20 | -- design resolution 21 | CONFIG_SCREEN_WIDTH = 320 22 | CONFIG_SCREEN_HEIGHT = 480 23 | 24 | -- auto scale mode 25 | CONFIG_SCREEN_AUTOSCALE = "FIXED_WIDTH" 26 | 27 | -- 声音文件扩展名 28 | SoundFileExtName = ".mp3" -- ".ogg" 29 | 30 | res = { 31 | bgMusic_mp3 = "bgMusic" .. SoundFileExtName, 32 | buttonEffet_mp3 = "buttonEffet" .. SoundFileExtName, 33 | explodeEffect_mp3 = "explodeEffect" .. SoundFileExtName, 34 | fireEffect_mp3 = "fireEffect" .. SoundFileExtName, -- unused 35 | mainMainMusic_mp3 = "mainMainMusic" .. SoundFileExtName, 36 | shipDestroyEffect_mp3 = "shipDestroyEffect" .. SoundFileExtName, 37 | arial_14_fnt = "arial-14.fnt", 38 | arial_14_png = "arial-14.png", 39 | b01_plist = "b01.plist", 40 | b01_png = "b01.png", 41 | cocos2d_html5_png = "cocos2d-html5.png", 42 | explode_plist = "explode.plist", -- unused 43 | explosion_plist = "explosion.plist", 44 | explosion_png = "explosion.png", 45 | flare_jpg = "flare.jpg", 46 | gameOver_png = "gameOver.png", 47 | level01_tmx = "level01.tmx", 48 | loading_png = "loading.png", 49 | logo_png = "logo.png", 50 | menu_png = "menu.png", 51 | menuTitle_png = "menuTitle.png", 52 | textureOpaquePack_plist = "textureOpaquePack.plist", 53 | textureOpaquePack_png = "textureOpaquePack.png", 54 | textureTransparentPack_plist = "textureTransparentPack.plist", 55 | textureTransparentPack_png = "textureTransparentPack.png" 56 | } 57 | -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/config/EnemyType.lua: -------------------------------------------------------------------------------- 1 | -- 敌人类型 2 | local EnemyType = { 3 | { 4 | type = 0, -- 类型ID 5 | textureName = "E0.png", -- 战机图片 6 | bulletType = "W2.png", -- 子弹图片 7 | HP = 1, -- 生命值 8 | moveType = MW.ENEMY_MOVE_TYPE.ATTACK, -- 移动类型(ATTACK、VERTICAL、HORIZONTAL、OVERLAP)(攻击、垂直、水平、重叠) 9 | attackMode = MW.ENEMY_MOVE_TYPE.NORMAL, -- 攻击模式(NORMAL、TSUIHIKIDAN) 10 | scoreValue = 15 -- 成绩值 11 | }, 12 | { 13 | type = 1, 14 | textureName = "E1.png", 15 | bulletType = "W2.png", 16 | HP = 2, 17 | moveType = MW.ENEMY_MOVE_TYPE.ATTACK, 18 | attackMode = MW.ENEMY_MOVE_TYPE.NORMAL, 19 | scoreValue = 40 20 | }, 21 | { 22 | type = 2, 23 | textureName = "E2.png", 24 | bulletType = "W2.png", 25 | HP = 4, 26 | moveType = MW.ENEMY_MOVE_TYPE.HORIZONTAL, 27 | attackMode = MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN, 28 | scoreValue = 60 29 | }, 30 | { 31 | type = 3, 32 | textureName = "E3.png", 33 | bulletType = "W2.png", 34 | HP = 6, 35 | moveType = MW.ENEMY_MOVE_TYPE.OVERLAP, 36 | attackMode = MW.ENEMY_MOVE_TYPE.NORMAL, 37 | scoreValue = 80 38 | }, 39 | { 40 | type = 4, 41 | textureName = "E4.png", 42 | bulletType = "W2.png", 43 | HP = 10, 44 | moveType = MW.ENEMY_MOVE_TYPE.HORIZONTAL, 45 | attackMode = MW.ENEMY_ATTACK_MODE.TSUIHIKIDAN, 46 | scoreValue = 150 47 | }, 48 | { 49 | type = 5, 50 | textureName = "E5.png", 51 | bulletType = "W2.png", 52 | HP = 15, 53 | moveType = MW.ENEMY_MOVE_TYPE.HORIZONTAL, 54 | attackMode = MW.ENEMY_MOVE_TYPE.NORMAL, 55 | scoreValue = 200 56 | } 57 | } 58 | 59 | return EnemyType -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/config/GameConfig.lua: -------------------------------------------------------------------------------- 1 | MW = {} 2 | 3 | -- game state 4 | MW.GAME_STATE = { 5 | HOME = 0, 6 | PLAY = 1, 7 | OVER = 2 8 | } 9 | 10 | -- keys 11 | MW.KEYS = {} 12 | 13 | -- level 14 | MW.LEVEL = { 15 | STAGE1 = 1, 16 | STAGE2 = 2, 17 | STAGE3 = 3 18 | } 19 | 20 | -- life 21 | MW.LIFE = 4 22 | 23 | -- score 24 | MW.SCORE = 0 25 | 26 | -- sound 27 | MW.SOUND = true 28 | 29 | -- enemy move type 30 | MW.ENEMY_MOVE_TYPE = { 31 | ATTACK = 0, 32 | VERTICAL = 1, 33 | HORIZONTAL = 2, 34 | OVERLAP = 3 35 | } 36 | 37 | -- delta x 38 | MW.DELTA_X = -100 39 | 40 | -- offset x 41 | MW.OFFSET_X = -24 42 | 43 | -- rot 44 | MW.ROT = -5.625 45 | 46 | -- bullet type 47 | MW.BULLET_TYPE = { 48 | PLAYER = 1, 49 | ENEMY = 2 50 | } 51 | 52 | -- weapon type 53 | MW.WEAPON_TYPE = { 54 | ONE = 1 55 | } 56 | 57 | -- unit tag 58 | MW.UNIT_TAG = { 59 | ENMEY_BULLET = 900, 60 | PLAYER_BULLET = 901, 61 | ENEMY = 1000, 62 | PLAYER = 1000 63 | } 64 | 65 | -- attack mode 66 | MW.ENEMY_ATTACK_MODE = { 67 | NORMAL = 1, 68 | TSUIHIKIDAN = 2 69 | } 70 | 71 | -- life up sorce 72 | MW.LIFEUP_SORCE = {50000, 100000, 150000, 200000, 250000, 300000} 73 | 74 | -- container 75 | MW.CONTAINER = { 76 | ENEMIES = {}, 77 | ENEMY_BULLETS = {}, 78 | PLAYER_BULLETS = {}, 79 | EXPLOSIONS = {}, 80 | SPARKS = {}, 81 | HITS = {}, 82 | BACKSKYS = {}, 83 | BACKTILEMAPS = {} 84 | } 85 | 86 | -- bullet speed 87 | MW.BULLET_SPEED = { 88 | ENEMY = -200, 89 | SHIP = 900 90 | } 91 | 92 | -- the counter of active enemies 93 | MW.ACTIVE_ENEMIES = 0 -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/config/Level.lua: -------------------------------------------------------------------------------- 1 | -- 等级一 2 | Level1 = { 3 | enemyMax = 6, -- 最大敌机数量 4 | enemies = { 5 | { 6 | ShowType = "Repeate", 7 | ShowTime = "00:02", 8 | Types = {0,1,2} 9 | }, 10 | { 11 | ShowType = "Repeate", 12 | ShowTime = "00:05", 13 | Types = {3,4,5} 14 | } 15 | -- { 16 | -- ShowType = "Repeate", 17 | -- ShowTime = "00:08", 18 | -- Types = {0,4,3,5} 19 | -- }, 20 | -- { 21 | -- ShowType = "Once", 22 | -- ShowTime = "00:6", 23 | -- Types = {0,2,4,3} 24 | -- }, 25 | -- { 26 | -- ShowType = "Once", 27 | -- ShowTime = "00:16", 28 | -- Types = {0,2,5,4,3} 29 | -- }, 30 | -- { 31 | -- ShowType = "Once", 32 | -- ShowTime = "00:25", 33 | -- Types = {0,3,5,4,3} 34 | -- }, 35 | -- { 36 | -- ShowType = "Once", 37 | -- ShowTime = "00:35", 38 | -- Types = {4,5,3,1,3} 39 | -- }, 40 | -- { 41 | -- ShowType = "Once", 42 | -- ShowTime = "00:50", 43 | -- Types = {0,3,2,1,0,3} 44 | -- }, 45 | -- { 46 | -- ShowType = "Once", 47 | -- ShowTime = "01:15", 48 | -- Types = {4,5,2,1,0} 49 | -- } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /源代码/moonwarriors/scripts/main.lua: -------------------------------------------------------------------------------- 1 | 2 | function __G__TRACKBACK__(errorMessage) 3 | print("----------------------------------------") 4 | print("LUA ERROR: " .. tostring(errorMessage) .. "\n") 5 | print(debug.traceback("", 2)) 6 | print("----------------------------------------") 7 | end 8 | 9 | require("app.MyApp").new():run() -------------------------------------------------------------------------------- /源代码/moonwarriors/sources/AppDelegate.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "cocos2d.h" 3 | #include "AppDelegate.h" 4 | #include "SimpleAudioEngine.h" 5 | #include "support/CCNotificationCenter.h" 6 | #include "CCLuaEngine.h" 7 | #include 8 | 9 | using namespace std; 10 | using namespace cocos2d; 11 | using namespace CocosDenshion; 12 | 13 | AppDelegate::AppDelegate() 14 | { 15 | // fixed me 16 | //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); 17 | } 18 | 19 | AppDelegate::~AppDelegate() 20 | { 21 | // end simple audio engine here, or it may crashed on win32 22 | SimpleAudioEngine::sharedEngine()->end(); 23 | } 24 | 25 | bool AppDelegate::applicationDidFinishLaunching() 26 | { 27 | // initialize director 28 | CCDirector *pDirector = CCDirector::sharedDirector(); 29 | pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); 30 | pDirector->setProjection(kCCDirectorProjection2D); 31 | 32 | // set FPS. the default value is 1.0/60 if you don't call this 33 | pDirector->setAnimationInterval(1.0 / 60); 34 | 35 | // register lua engine 36 | CCLuaEngine *pEngine = CCLuaEngine::defaultEngine(); 37 | CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine); 38 | 39 | CCLuaStack *pStack = pEngine->getLuaStack(); 40 | 41 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) 42 | // load framework 43 | pStack->loadChunksFromZIP("res/framework_precompiled.zip"); 44 | 45 | // set script path 46 | string path = CCFileUtils::sharedFileUtils()->fullPathForFilename("scripts/main.lua"); 47 | #else 48 | #ifdef DEBUG 49 | // load framework 50 | if (m_projectConfig.isLoadPrecompiledFramework()) 51 | { 52 | const string precompiledFrameworkPath = SimulatorConfig::sharedDefaults()->getPrecompiledFrameworkPath(); 53 | pStack->loadChunksFromZIP(precompiledFrameworkPath.c_str()); 54 | } 55 | #else 56 | // load framework 57 | pStack->loadChunksFromZIP("res/framework_precompiled.zip"); 58 | #endif 59 | 60 | // set script path 61 | string path = CCFileUtils::sharedFileUtils()->fullPathForFilename(m_projectConfig.getScriptFileRealPath().c_str()); 62 | #endif 63 | 64 | #ifdef ENCRYPT_LUA 65 | pStack->setXXTEAKeyAndSign(ENCRYPT_KEY, strlen(ENCRYPT_KEY), "XXTEA", strlen("XXTEA")); 66 | pStack->loadChunksFromZIP("res/game.zip"); 67 | pStack->executeString("require 'main'"); 68 | #else 69 | #ifdef ENCRYPT_PIC 70 | pStack->setXXTEAKeyAndSign(ENCRYPT_KEY, strlen(ENCRYPT_KEY), "XXTEA", strlen("XXTEA")); 71 | #endif 72 | 73 | size_t pos; 74 | while ((pos = path.find_first_of("\\")) != std::string::npos) 75 | { 76 | path.replace(pos, 1, "/"); 77 | } 78 | size_t p = path.find_last_of("/\\"); 79 | if (p != path.npos) 80 | { 81 | const string dir = path.substr(0, p); 82 | pStack->addSearchPath(dir.c_str()); 83 | 84 | p = dir.find_last_of("/\\"); 85 | if (p != dir.npos) 86 | { 87 | pStack->addSearchPath(dir.substr(0, p).c_str()); 88 | } 89 | } 90 | 91 | string env = "__LUA_STARTUP_FILE__=\""; 92 | env.append(path); 93 | env.append("\""); 94 | pEngine->executeString(env.c_str()); 95 | 96 | CCLOG("------------------------------------------------"); 97 | CCLOG("LOAD LUA FILE: %s", path.c_str()); 98 | CCLOG("------------------------------------------------"); 99 | pEngine->executeScriptFile(path.c_str()); 100 | #endif 101 | 102 | return true; 103 | } 104 | 105 | 106 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too 107 | void AppDelegate::applicationDidEnterBackground() 108 | { 109 | CCDirector::sharedDirector()->stopAnimation(); 110 | CCDirector::sharedDirector()->pause(); 111 | SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); 112 | SimpleAudioEngine::sharedEngine()->pauseAllEffects(); 113 | CCNotificationCenter::sharedNotificationCenter()->postNotification("APP_ENTER_BACKGROUND_EVENT"); 114 | } 115 | 116 | // this function will be called when the app is active again 117 | void AppDelegate::applicationWillEnterForeground() 118 | { 119 | CCDirector::sharedDirector()->startAnimation(); 120 | CCDirector::sharedDirector()->resume(); 121 | SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); 122 | SimpleAudioEngine::sharedEngine()->resumeAllEffects(); 123 | CCNotificationCenter::sharedNotificationCenter()->postNotification("APP_ENTER_FOREGROUND_EVENT"); 124 | } 125 | 126 | void AppDelegate::setProjectConfig(const ProjectConfig& config) 127 | { 128 | m_projectConfig = config; 129 | } 130 | -------------------------------------------------------------------------------- /源代码/moonwarriors/sources/AppDelegate.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _APP_DELEGATE_H_ 3 | #define _APP_DELEGATE_H_ 4 | 5 | #include "CCApplication.h" 6 | #include "ProjectConfig/SimulatorConfig.h" 7 | 8 | #define ENCRYPT_LUA 9 | #define ENCRYPT_PIC 10 | #define ENCRYPT_KEY "XXTEA_KEY" 11 | #define DEBUG_WORK_DIR "E:/Demo/cocos2d-x/quick-cocos2d-x-2.2.5/projects/moonwarriors" 12 | 13 | /** 14 | @brief The cocos2d Application. 15 | 16 | The reason for implement as private inheritance is to hide some interface call by CCDirector. 17 | */ 18 | class AppDelegate : public cocos2d::CCApplication 19 | { 20 | public: 21 | AppDelegate(); 22 | virtual ~AppDelegate(); 23 | 24 | /** 25 | @brief Implement CCDirector and CCScene init code here. 26 | @return true Initialize success, app continue. 27 | @return false Initialize failed, app terminate. 28 | */ 29 | virtual bool applicationDidFinishLaunching(); 30 | 31 | /** 32 | @brief The function be called when the application enter background 33 | @param the pointer of the application 34 | */ 35 | virtual void applicationDidEnterBackground(); 36 | 37 | /** 38 | @brief The function be called when the application enter foreground 39 | @param the pointer of the application 40 | */ 41 | virtual void applicationWillEnterForeground(); 42 | 43 | void setProjectConfig(const ProjectConfig& config); 44 | 45 | private: 46 | ProjectConfig m_projectConfig; 47 | }; 48 | 49 | #endif // _APP_DELEGATE_H_ 50 | -------------------------------------------------------------------------------- /界面截图/主界面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/界面截图/主界面.png -------------------------------------------------------------------------------- /界面截图/关于.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/界面截图/关于.png -------------------------------------------------------------------------------- /界面截图/开始菜单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/界面截图/开始菜单.png -------------------------------------------------------------------------------- /界面截图/游戏结束.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/界面截图/游戏结束.png -------------------------------------------------------------------------------- /界面截图/设置.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zym2014/MoonWarriors-lua/fad2cca3ce147cac174c67c54a7c5ad749464309/界面截图/设置.png --------------------------------------------------------------------------------