当前位置:网站首页>【oops-framework】模板项目【oops-game-kit】使用简介
【oops-framework】模板项目【oops-game-kit】使用简介
2022-08-11 01:40:00 【dgflash_game】
Oops Game Kit介绍
基于 Oops Framework 提供的游戏项目开发模板,项目中提供了最新版本 Cocos Creator 3.x 插件与游戏资源初始化通用逻辑。
创建游戏模板项目
- 下载模板项目
git clone https://gitee.com/dgflash/oops-game-kit.git
第一次安装框架插件
windows
md extensions
cd extensions
git clone -b master https://gitee.com/dgflash/oops-plugin-framework.git
git pull
mac
mkdir -p extensions
cd extensions
git clone -b master https://gitee.com/dgflash/oops-plugin-framework.git
git pull
模板项目目录结构
res - 预制引用的静态资源
resources - 动态加载引用的资源
audio - 音乐资源
common - 公共资源
config - 配置资源
game - 游戏自定义内容配置数据表
config.json - 框架默认配置资源(可扩展内容)
content - 自定义动态加载内容资源
game - 核心玩法内容资源
gui - 界面资源
loading - 游戏初次加载界面
language - 多语言资源
script - 游戏脚本
game - 游戏业务模块
common - 游戏公共模块
config - 游戏配置
GameEvent.ts - 全局事件配置
GameUIConfig.ts - 界面窗口配置(提供oops.gui模块使用的配置数据)
table - 游戏配置表对象(可通过oops-plugin-excel-to-json自动生成)
initialize - 游戏初始化模块
SingletonModuleComp.ts - 游戏单例业务模块
Main.ts - 游戏入口脚本
根据上面的目录结构,在开发游戏时,可将资源存放到对应的文件夹中管理。这套模板项目自带以下游戏必备功能。
- 屏幕自适应
- 游戏本地配置数据获取
- 游戏地址查询参数获取
- 游戏初始化业务流程
- 初始可自定义资源加载提示界面
- 加载与现实第一个游戏自定义界面
屏幕自适应
Cocos Creator 菜单->项目->项目设置
横屏自适应

竖屏自适应

设置好后,其它的交给框架自动处理即可,如果有特殊的自适应需求的,可加入到QQ交流群中讨论。
游戏初始化模块
游戏启动时加载的必备资源
initialize/bll/InitRes.ts
这个脚本管理游戏启动时加载的必备资源,此处要注意的是,这里配置的资源尽量小一些,避免无提示加载阶段黑屏时间过长,导致游戏体验下降。
- 加载公共资源
- 加载多语言包(可选)
- 加载自定义资源(可选)
initialize/view/LoadingViewComp.ts
这个脚本是游戏内容资源加载界面的控制脚本,游戏内容资源一般较大,会有加载进度条提示来提高游戏体验。所有资源加载完后,会通过执行以下脚本来显示游戏第一个自定义界面。
oops.gui.open(UIID.Demo);
边栏推荐
猜你喜欢

22-7-31

Linux安装redis数据库
![[Server data recovery] Data recovery case of lvm information and VXFS file system corruption caused by raid5 crash](/img/dc/043f861507fc16530446bf051941ef.jpg)
[Server data recovery] Data recovery case of lvm information and VXFS file system corruption caused by raid5 crash

apache+PHP+MySQL+word press, page error when installing word press?

ABP中的数据过滤器

Data Filters in ABP

编程技巧│selenium 更新 chromedriver 驱动

22. Inventory service

【ASM】字节码操作 ClassWriter COMPUTE_FRAMES 的作用 与 visitMaxs 的关系

如何防止离职员工把企业文件拷贝带走?法律+技术,4步走
随机推荐
Summarize the acquisition of commonly used file information QFileInfo in Qt: suffix, name, path, link
最新国产电源厂家及具体型号pin-to-pin替代手册发布
The latest domestic power supply manufacturers and pin-to-pin replacement manuals for specific models are released
Is container technology really the savior of environmental management?
MSTP - Multiple Spanning Tree (Case + Configuration)
本周四晚19:00知识赋能第六期第5课丨OpenHarmony WiFi子系统
This Thursday evening at 19:00, Lesson 5 of the sixth phase of knowledge empowerment丨OpenHarmony WiFi subsystem
FPGA学习专栏-串口通信(xinlinx)
络达开发---自定义Timer的实现
还在用 Xshell?你 out 了,推荐一个更现代的终端连接工具,好用到爆!
[The method of calling the child page from the parent page of the iframe] Stepping on the pit: It is the key to use `[x]` when getting elements. You cannot use `.eq(x)`, otherwise it will not be obtai
两日总结十
两日总结九
22-7-31
WinForm (5) control and its members
C# string与stream的相互转换
Experiment record of Shengxin (part3)--scipy.spatial.distance_matrix
络达开发---串口日志&日志过滤
Ora - 00001 in violation of the only constraint
Exception: try catch finally throws throw