Giter Site home page Giter Site logo

minigame-lockstep-demo's Introduction

帧同步游戏服务示例

简介

本项目为小游戏帧同步服务配套示例,clone代码至任意文件夹再导入至最新版微信开发者工具即可运行。为了让示例尽可能轻量,本项目采用了渲染引擎Pixi.js。

游戏玩法很简答,可以1V1房间邀请微信好友对战,游戏开始后,每个玩家有一定的血量,任意一方血量为零游戏结束。

运行截图

demo

文件目录

|-- src
    |-- config.js          // 游戏逻辑相关配置
    |-- databus.js         // 全局状态管理器
    |-- gameserver.js      // 帧同步服务使用核心代码
    |-- index.js           // 游戏主函数
    |-- base               // 游戏基础类集合
    |   |-- bg.js          // 游戏背景类
    |   |-- bullet.js      // 子弹类
    |   |-- debug.js       // 调试信息类
    |   |-- hp.js          // 血条类
    |   |-- joystick.js    // 虚拟摇杆类
    |   |-- login.js       // 登录类
    |   |-- music.js       // 音效管理类
    |   |-- player.js      // 玩家类
    |   |-- skill.js       // 技能按键类
    |   |-- tween.js       // 缓动类
    |-- common             // 游戏内通用函数集合
    |   |-- ui.js          // ui辅助函数
    |   |-- util.js        // 各种通用函数集合
    |-- scenes             // 游戏场景集合
        |-- battle.js      // 对战场景
        |-- home.js        // 游戏主页场景
        |-- result.js      // 对战结算场景
        |-- room.js        // 房间界面场景

minigame-lockstep-demo's People

Contributors

yuanzm 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.