GithubHelp home page GithubHelp logo

onenightwolfman's Introduction

One Night Ultimate Werewolf 一夜终极狼人

TODOs

frontend

  • 注册登录
  • 房间列表
  • 游戏界面

backend

  • 用户系统
  • 游戏核心玩法逻辑
  • 异常捕获与处理

QA

  • API单元测试
  • 全自动后端游戏流程测试js脚本
  • APP用户测试全流程说明

Development Log

Run

Frontend

dependency

  • Nodejs
  • React
    • axios
    • serve
    • react-router-dom
  • antd

Backend

dependency

  • django
  • uvicorn
  • channels
  • channels-redis
  • redis

Prepare Django Database

To use Django Channel Websocket features, we use uvicorn ASGI server as the backend server.

cd backend/wolfBackend
uvicorn wolfBackend.asgi:application

Game Logic

Charactors & Orders

- DOPPELGANGER = 0    # 化身幽灵
- WEREWOLF  = 1       # 狼人
- MINION = 2          # 爪牙
- MASON = 3           # 守夜人
- SEER = 4            # 预言家
- ROBBER = 5          # 强盗
- TROUBLEMAKER = 6    # 捣蛋鬼
- DRUNK = 7           # 酒鬼
- INSOMNIAC = 8       # 失眠者
- VILLAGER = 9        # 村民
- HUNTER = 10         # 猎人
- TANNER = 11         # 皮匠

Game settings

{
    "interval": 15,
    "num_players": 8,
    "roles": {
        "doppelganger": 0,
        "werewolf": 2,
        "minion": 1,
        "mason": 2,
        "seer": 1,
        "robber": 1,
        "troublemaker": 1,
        "drunk": 1,
        "insomniac": 1,
        "hunter": 1,
    }
}

Message

{
    "type": 3,
    "message": {
        "settings": {},
        "player": "",
        "player_index": 0,
        "target": [],
    }
}

Notes

前端:

  • 用户注册登录
  • 用户创建房间
    • 房间设置
  • 用户加入房间
    • 加入websocket用户组
  • 用户开始游戏
    • 和游戏服务器建立连接

后端:

  • 数据库
    • 用户数据
    • 游戏历史数据
    • 数据备份与恢复
  • 服务器
    • 房间数据
    • 游戏服务器
      • 游戏主逻辑
      • 游戏全局锁
      • 玩家重连机制
      • 聊天
      • 语音(暂不考虑)

onenightwolfman's People

Contributors

burning846 avatar

Stargazers

 avatar

Watchers

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