# gad_create_game **Repository Path**: drop_drop/gad_create_game ## Basic Information - **Project Name**: gad_create_game - **Description**: 天新游戏 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-03 - **Last Updated**: 2020-12-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gad_create_game #### 介绍 天新游戏 #### 软件架构 基于jquery、html、css、JavaScript(es6) ## 框架领域 手机端web卡牌角色类弱移动类游戏。 eg:塔防战、坦克战、飞机站、贪吃蛇等,伪多人游戏(未来将逐渐实现实时多人游戏)。 #### 框架设计原理 基于jquery和html、JavaScript,实现控件动态交互,动态碰撞检测。 ## 框架目标 实现界面与功能分离,功能模块化,组件绑定关联即可实现游戏效果。 #### 框架分层设计 web/* 业务代码: controller(控制器): 管理数据存取、逻辑与路由 //model(模型):管理数据绑定 (暂不启用) view(视图):管理html界面文件 框架文件 : gcg/* * jquery:jq库 * libs:框架核心文件 * config 配置管理 * constants 常量 * container 容器 * crash 碰撞相关 * foe 敌军相关 * log 日志 * role 角色相关 * timer 任务管理器 * tools 工具 #### 开发工具 推荐:PHPStorm 理由:初始化模块时,会自动帮助导入相应模块,减少大量错误省去大量调试时间。 ps:导入的模块没有.js后缀,需要手动加上. #### 安装教程 后续补上. 1. xxxx 2. xxxx 3. xxxx #### 使用说明 //要使用以下功能,将当前js文件在html文件中引入即可 //引入代码: ```` ```` //test.js文件 ```` //导入相关模块 import {Move} from "../../../gcg/libs/role/body/Move.js";//移动组件 import {Interval} from "../../../gcg/libs/timer/Interval.js";//任务管理器 import {Role} from "../../../gcg/libs/role/role/Role.js";//角色组件 import {Crash} from "../../../gcg/libs/crash/Crash.js";//碰撞组件 import {CompeteConstant} from "../../../gcg/libs/constants/CompeteConstant.js";//对抗常量 !function () { //初始化友军对象 let role = new Role('role'); role.compete = CompeteConstant.FRIEND; role.setNickname();//可选 role.setTop(50);//可选 role.setLeft(80);//可选 //初始化敌军对象//可选 // let foe = new Role('foe'); // foe.compete = CompeteConstant.FOE; // foe.setNickname(); //初始化移动组件 let move = new Move(role); move.step = 1;//设置步长(可配合频率达到平滑效果) //初始化碰撞检测组件 // let crash = new Crash(role, foe);//传入友军和敌军,碰撞会被检测 let crash = new Crash(role); //初始化任务管理器 let interval = new Interval(); interval.time = 30; interval.set(function () { //按方位移动 // move.up();//上 move.down();//下 // move.left();//左 // move.right();//右 //检测碰撞[友军碰撞敌军] // crash.detect(role, foe, function () { // interval.stop(); // }); //检测(友军)碰撞窗口边界 crash.detectBody(role, function () { //其它代码逻辑 interval.stop();//碰撞后停止 //其它代码逻辑 }) }); }(); ```` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)