Giter VIP home page Giter VIP logo

blocker's Introduction

Blocker

Build Status

Multiplayer online game using Phaser + WebSocket (Socket.IO).

Control

1. Mouse
- Left: move
- Right: fire

2. Keyboard
- Up: move
- Left / Right: rotate
- Spacebar: fire

Gifshot

Demo

Blocker - Game play 1

Blocker - Debug

Getting Started

  1. Install Node.js
  2. Install Nodemon Bower Gulp: npm install -g nodemon yarn bower pm2
  3. Install dependencies: yarn && bower install
Build client side
- dev: `yarn build.watch`
- prod: `yarn build`
Start server side
- dev: `nodemon app.js --watch app.js`
- prod: `pm2 start app.js`

Note

1. Code guideline & Naming we use
1.1 Base javascript style: [Airbnb](https://github.com/airbnb/javascript)
1.2 Function should return only one type
  e.g.
  - getName: string, '' (default)
  - getRandomInt: number, 0 (default)
  - getPlayers: Array, [] (default)
  - getPlayer: Object, {} (default)

  except getIndex
  e.g.
  - getIndexOfPlayer: number, -1 (default)

2. Naming
- Function / scope variable: `camelCase`  
- Global variable: `UPPERCASE`
- Class: `PascalCase`

3. Creature
- Monster
  - Zombie
  - Machine
  - Bat
- Hero
  - Player / Enemy

4. Socket
- Send to specific client: IO.sockets.connected[socketId].emit(EVENT_NAME, data);
- Send to all clients: IO.emit(EVENT_NAME, data);
- Send to all clients except newly created connection: socket.broadcast.emit(EVENT_NAME, data);

5. Event flow
Anything's related with `life` directly, is need to broadcast first then
take effect from subsequent request. (currently, there are only 2 events
(move / fire) that can execute on client before broadcasting)

6. CommonJs

TODO

  • All game calculation should be calculated on server-side
  • Define structure of sending-object and response-object from server
  • Send player-event to server (not data-object)
  • Check const and let again
  • Make all functions functional
  • Remove all eslint-disable-line
  • Add checkAlive event: the player is already gone, but it's still in the game (cause from network issue)
  • Using MessagePack instead of JSON
  • Respawn delay
  • Redirect all pages to root (cause we only use root page)
  • Update bubble/message graphic, 1
  • Add deploy shell script
  • Day / Night system
  • Implement Shields.io
  • minimap, 1, 2, 3
  • Responsive (support mobile / tablet user)
  • Support screen when resizing
  • HUD
  • Score board (Leader board)
  • Cache
  • Knockback when creature is hitted
  • Add test (TDD) with test-task-runner, 1
  • QA - Analysis / Optimize / Profiling / ETC (e.g. sonarqube)
  • Sound
  • Effect / Screen transition / Screen shake
  • Fix - Creature is damaged and welled in the same time
  • Arrow / Laser is killed when hit stoneGroup
  • Room / Channel (able to create private room), 1, 2, 3
  • Add social meta / share
  • Bot player
  • Tween: player move
  • Hero can collect item in the floor
  • Other class (e.g. Swordsman)
  • Monster path finder, 1, 2, 3
  • Creature sight feature, 1, 2, 3
  • Monster walk - random walk
  • Monster can be fired, welled
  • Talkable monster
  • Tween: monster move

Reference & Tutorial & Plugin & Tool

Multiplayer

  • Introduction to development of multiplayer HTML5 games (with Socket.io) 1, 2

Data structure

blocker's People

Contributors

jojoee avatar mircobabini 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blocker's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

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.