timlin0307 / JS_WebSocket_Gaming_Project

JS WebSocket Gaming Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS_WebSocket_Gaming_Project

JS_WebSocket_Gaming_Project


Development of Game Server

  • [Done] Single client to Single server
  • [Done] Using express-ws to activate WebSocket
  • [Done] Multiple clients to Single server (broadcast msg to other all clients)
  • [Done] Detection of client's disconnection
  • [Done] Identification of each client
  • [Done] Create database by sql3 & sqlite
  • [Done] Read player data from database before starting game
  • [Done] Add a status in db to check whether player is been used or not
  • [Done] Update db account status if player login
  • [Done] Different players have different token while connecting to server (personal account)
  • [Done] Update db player status (character, position, direction, ...) if player moves

Development of Game View

  • [Done] Player's character controls (left, right, up, down)
  • [Done] Characters always stay in the center
  • [Done] Login page before playing game
  • [Done] Body & Item block
  • [Done] One client can see player controlled by another client
  • [Done] Two client controll different player
  • [Done] Three client controll different player by different computer (only three now)
  • [Done] Clients login at different time but still having same view (body block & direction)

Important Command

  1. In order for npm to manage our modules (create a configuration file named “package.json”)
npm init
  1. To add a module (create a folder named node_modules)
npm add --save express
npm add express express-ws
  1. Use npm to install the ws (WebSocket) module and to check WebSocket version
npm install --save ws
npm ls ws
  1. To run this game, in a terminal placed in the folder where “server.js” is located
node server.js
  1. To create a database "db.sqlite"
node db.js
  1. To create initial data in "db.sqlite"
node db_init.js

Problems


References

About

JS WebSocket Gaming Project


Languages

Language:JavaScript 90.3%Language:HTML 4.9%Language:CSS 4.8%