当前位置:网站首页>Oops novice template Framework project guide
Oops novice template Framework project guide
2022-08-11 01:56:00 【dgflash_game】
Oops FrameworkOpen source has been open for more than a year now,Many students joined the exchange of frameworksQQ群中,Trying to learn and use this framework to develop games.
在这段时间中,Also came into contact with some first tryCocos CreatorStudents who develop games,After seeing the framework code,It feels like there is more content in the frame,Not sure where to start learning.Therefore, in the follow-up maintenance, most modules are further designed to be optional,设计思路与Cocos CreatorThe module culling function in .And these technical points,It is not strongly dependent on the game business,It can be selected after we understand it,This allows for smoother learning,Learn one technical point per project.
Also designed a set of game project templates,After downloading directly, you can develop custom game business logic on it,Save after downloading the demo project,Also manually remove unnecessary demo code.
Oops Framework 介绍
Oops Framework是基于Cocos Creato 3.xgame engine with TypeScriptSet of game boxes for language design.
The framework encapsulates common techniques for game development,Make game development easier,提高开发效率.Let developers focus more on game content and game experience,Thereby improving the quality of the game.
The latest version of the framework is provided as a plugin,The purpose of this design is that subsequent upgrades only need to be performed on the plugin directorygit pullYou can update to the latest version.
The business coupling between framework modules is low,coreThe content under the folder is the core code of the framework,Essential technology for game development;libsFolders are optional technology,Unnecessary content can be customized according to the project situation;moduleThe folder is the general module of the game,可以理解为core或libsspecific applications of the technology.
Plug-in version of the framework source codeDirectory structure and module descriptions
core - Box plus core technology library
common - Game public module
audio - 音频模块
event - 全局事件
loader - 加载模块
log - 日志模块
manager - 时间管理、random management
storage - 本地存储
game - 游戏世界类
gui - 游戏界面类
layer - Multilayer interface、窗口管理
prompt - Common prompt window
utils - A library of tools for games
Oops.ts - Framework function access interface
Root.ts - The frame view layer root node manages components
libs - Optional technology library in the framework
animator - 动画状态机
animator-effect - Animation effects components
animator-move - Animate moving components
behavior-tree - Behavior tree framework
camera - 3D camera control component
collection - Data collection processing
ecs - ECS框架
gui - 界面组件
badge - Red dots suggest components
button - 按钮组件
label - 标签组件
language - 多语言组件
model-view - MVVM框架
network - 网络模块
render-texture - Render texture components
security - 安全组件
module - Game general module
common - 公共模块
config - 配置模块
Create a game template project
- 下载模板项目
git clone https://gitee.com/dgflash/oops-game-kit.git
注:The template project is based onCocos Creator 3.6开发,Please download the latest version of the editor to open the project,点击下载 Cocos Creator 3.6,Subsequent official editions can be directly publishedCocosDashboard中下载.
Install the framework plugin for the first time
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
Template project directory structure
res - Prefab referenced static resources
resources - Dynamically load referenced resources
audio - 音乐资源
common - 公共资源
config - 配置资源
game - Game custom content configuration data sheet
config.json - The framework configures resources by default(可扩展内容)
content - Customize dynamically loaded content resources
game - Core gameplay content resources
gui - 界面资源
loading - Game loading interface for the first time
language - 多语言资源
script - 游戏脚本
game - Game business module
common - Game public module
config - 游戏配置
GameEvent.ts - Global event configuration
GameUIConfig.ts - Interface window configuration(提供oops.guiConfiguration data used by the module)
table - Game configuration table object(可通过oops-plugin-excel-to-json自动生成)
initialize - Game initialization module
SingletonModuleComp.ts - Game singleton business module
Main.ts - 游戏入口脚本
根据上面的目录结构,在开发游戏时,Resources can be stored in corresponding folders for management.This template project comes with the following essential game features.
- 屏幕自适应
- Game local configuration data acquisition
- Game address query parameter acquisition
- The game initiates the business process
- Initial customizable resource loading prompt interface
- Load up with a realistic first game custom interface
屏幕自适应
Cocos Creator 菜单->项目->项目设置
Landscape adaptive
Vertical screen adaptation
设置好后,The rest can be handled automatically by the framework.
Game initialization module
A must-have resource to load when the game starts
initialize/bll/InitRes.ts
This script manages the necessary resources that are loaded when the game starts,此处要注意的是,The resources configured here are as small as possible,Avoid prolonged black screen during silent loading phase,Deteriorating the gaming experience.
- 加载公共资源
- 加载多语言包(可选)
- 加载自定义资源(可选)
initialize/view/LoadingViewComp.ts
This script is the control script for the game content resource loading interface,Game content resources are generally large,There will be a loading progress bar prompt to improve the game experience.After all resources are loaded,The first custom screen for the game is displayed by executing the following script.
oops.gui.open(UIID.Demo);
The next step is to develop custom game logic,Module code style can refer toOops FrameworkThe role module implementation in .
学习交流 QQ 群:798575969
边栏推荐
猜你喜欢
Tomca启动闪退问题如何解决
MSTP - Multiple Spanning Tree (Case + Configuration)
21、阿里云oss
paddle2.3和torch1.8在SentenceBert上的性能对比
Flink二阶段提交
Matlab矩阵(数组)元素过滤常见方法详解
络达开发---自定义Timer的实现
最新国产电源厂家及具体型号pin-to-pin替代手册发布
R language multiple linear regression, ARIMA analysis of the impact of different candidates in the United States on the economic GDP time series
阿里的数据同步神器——Canal
随机推荐
Vim take on a window.
[oops-framework] Template project [oops-game-kit] Introduction
How to realize the repeatable design of FPGA
Deep Learning [Chapter 2]
How to determine the size of the version number
Still using Xshell?You are out, recommend a more modern terminal connection tool, easy to use!
Tomca启动闪退问题如何解决
软件测试面试题:性能测试工作?
R language multiple linear regression, ARIMA analysis of the impact of different candidates in the United States on the economic GDP time series
php 判断数组是否为多维数组
划分字母区间[贪心->空间换时间->数组hash优化]
微信公众号后台管理
MySQL indexes and transactions
软件测试面试题:验收测试包括哪三种类型?
进程间通信方式(1)无名管道(全CSDN最用心的博主)
Summarize the acquisition of commonly used file information QFileInfo in Qt: suffix, name, path, link
paddle2.3和torch1.8在SentenceBert上的性能对比
Detailed explanation of the opkg of OpenWrt
Lianshengde W801 series 6-Analyze the Bluetooth communication source code of W801 from the perspective of WeChat applet (indicate method)
Update chromedriver driver programming skills │ selenium