Giter Site home page Giter Site logo

dgflash / oops-game-kit Goto Github PK

View Code? Open in Web Editor NEW
28.0 1.0 14.0 3.84 MB

基于 Oops Framework 提供的游戏项目开发模板,项目中提供了最新版本 Cocos Creator 3.x 插件与游戏资源初始化通用逻辑。

License: MIT License

TypeScript 91.69% JavaScript 0.15% Batchfile 4.02% Shell 4.13%

oops-game-kit's Introduction

oops-game-kit

介绍

基于 Oops Framework 提供的游戏项目开发模板,项目中提供了最新版本 Cocos Creator 3.x 插件与游戏资源初始化通用逻辑。

使用Oops Framework创建游戏模板项目

  1. 下载模板项目
git clone https://gitee.com/dgflash/oops-game-kit.git
  1. 下载框架插件

windows

  • 执行 update-oops-plugin-framework.bat 克隆与更新框架插件
  • 执行 update-oops-plugin-hot-update.bat 克隆与更新热更新插件
  • 执行 update-oops-plugin-excel-to-json.bat 克隆与更新Excel转Json格式插件

mac

  • 执行 update-oops-plugin-framework.sh 克隆与更新框架插件
  • 执行 update-oops-plugin-hot-update.sh 克隆与更新热更新插件
  • 执行 update-oops-plugin-excel-to-json.sh 克隆与更新Excel转Json格式插件

模板项目目录结构

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 菜单->项目->项目设置

横屏自适应

竖屏自适应

设置好后,其它的交给框架自动处理即可。

游戏初始化模块

游戏启动时加载的必备资源

initialize/bll/InitRes.ts

这个脚本管理游戏启动时加载的必备资源,此处要注意的是,这里配置的资源尽量小一些,避免无提示加载阶段黑屏时间过长,导致游戏体验下降。

  • 加载公共资源
  • 加载多语言包(可选)
  • 加载自定义资源(可选)

initialize/view/LoadingViewComp.ts

这个脚本是游戏内容资源加载界面的控制脚本,游戏内容资源一般较大,会有加载进度条提示来提高游戏体验。所有资源加载完后,会通过执行以下脚本来显示游戏第一个自定义界面。

oops.gui.open(UIID.Demo);

QQ群

  • 798575969(1群)
  • 621415300(2群)
  • 628575875(3群)

QQ频道扫码加入,提供教程,持续更新

oops-game-kit's People

Contributors

bansomin avatar dgflash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.