标签:
至此,功夫小子系列的Cocos2d-x的实战文章就结束了。
再次贴个目录以便检索:
功夫小子专栏地址:http://blog.csdn.net/column/details/suoolcocoshit.html
但是如同在第一节课说的,我们的项目在3.0版本创建,使用了一些库,所以打包之前需要更改下我们的Android.mk文件
更改后文件内容如下:
LOCAL_PATH :=$(call my-dir) include$(CLEAR_VARS) LOCAL_MODULE :=cocos2dcpp_shared LOCAL_MODULE_FILENAME:= libcocos2dcpp # 遍历目录及子目录的函数 define walk $(wildcard $(1))$(foreach e, $(wildcard $(1)/*), $(call walk, $(e))) endef # 遍历Classes目录 ALLFILES = $(callwalk, $(LOCAL_PATH)/../../Classes) FILE_LIST :=hellocpp/main.cpp # 从所有文件中提取出所有.cpp文件 FILE_LIST +=$(filter %.cpp, $(ALLFILES)) LOCAL_SRC_FILES :=$(FILE_LIST:$(LOCAL_PATH)/%=%) LOCAL_C_INCLUDES:= $(LOCAL_PATH)/../../Classes # 添加库的引用 LOCAL_WHOLE_STATIC_LIBRARIES:= cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES+= cocosdenshion_static LOCAL_WHOLE_STATIC_LIBRARIES+= box2d_static LOCAL_WHOLE_STATIC_LIBRARIES+= cocos_extension_static LOCAL_WHOLE_STATIC_LIBRARIES+= cocostudio_static LOCAL_WHOLE_STATIC_LIBRARIES+= cocos_ui_static include$(BUILD_SHARED_LIBRARY) $(callimport-module,2d) $(callimport-module,audio/android) $(callimport-module,Box2D) $(callimport-module,extensions) $(callimport-module,editor-support/cocostudio) $(callimport-module,ui)
/**************************************************************************** Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ package org.cocos2dx.cpp; import org.cocos2dx.lib.Cocos2dxActivity; import org.cocos2dx.lib.Cocos2dxGLSurfaceView; import android.view.WindowManager; import android.media.AudioManager; public class AppActivity extends Cocos2dxActivity { public Cocos2dxGLSurfaceView onCreateView() { super.onCreateView(); Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); return glSurfaceView; } }
希望大家能够通过本系列教材学习到Cocos的基本组件和核心模块的相关知识,并对游戏开发有一个大概的认识。我也是菜鸟一枚,所以不喜勿喷。
另,源码已经在github上。关于资源请邮件我索要,资源仅限于学习交流之用,请勿用于其他的商业用途,资源的版权归原作者所有,谢谢您的理解。
期待和您一些学习交流。
我自己想到一些改进的方向如下:
1. 使用有限状态机(FSM)改写本游戏项目
2. 为怪物添加更强大的AI,改进现有的碰撞检测
3. 怪物的产生使用读取配置文件的方式
4. 将游戏GameLayer各个层分开实现,降低程序的耦合性。
5. 优化游戏
6. 结合自己的思考进一步改进现有的设计。
另外是一些资源的共享网盘地址如下:
资源分享网盘地址:http://pan.baidu.com/s/1gds6vfX
版权声明:本文为博主原创文章,未经博主允许不得转载。
【Cocos游戏实战】功夫小子第八课之游戏打包和相关问题说明
标签:
原文地址:http://blog.csdn.net/suool/article/details/47129067