{"id":14964017,"url":"https://github.com/jojoee/blocker","last_synced_at":"2025-10-14T22:36:40.920Z","repository":{"id":47181601,"uuid":"67862457","full_name":"jojoee/blocker","owner":"jojoee","description":":video_game: (WIP - phase 3) Multiplayer online game using Phaser + WebSocket (Socket.IO)","archived":false,"fork":false,"pushed_at":"2023-11-08T01:20:30.000Z","size":724,"stargazers_count":54,"open_issues_count":2,"forks_count":23,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-31T05:33:27.333Z","etag":null,"topics":["game","multiplayer-online-game","phaser","phaserjs","socket-io"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jojoee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-10T09:24:13.000Z","updated_at":"2024-12-30T07:52:58.000Z","dependencies_parsed_at":"2024-09-18T18:15:48.299Z","dependency_job_id":null,"html_url":"https://github.com/jojoee/blocker","commit_stats":{"total_commits":166,"total_committers":2,"mean_commits":83.0,"dds":"0.0060240963855421326","last_synced_commit":"343c8f1db67699d1d0d4c2a5f9c35707472c1733"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fblocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fblocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fblocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fblocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jojoee","download_url":"https://codeload.github.com/jojoee/blocker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238075269,"owners_count":19412307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","multiplayer-online-game","phaser","phaserjs","socket-io"],"created_at":"2024-09-24T13:32:28.674Z","updated_at":"2025-10-14T22:36:35.899Z","avatar_url":"https://github.com/jojoee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blocker\n[![Build Status](https://travis-ci.org/jojoee/blocker.svg)](https://travis-ci.org/jojoee/blocker)\n\nMultiplayer online game using Phaser + WebSocket (Socket.IO).\n\n## Control\n```\n1. Mouse\n- Left: move\n- Right: fire\n\n2. Keyboard\n- Up: move\n- Left / Right: rotate\n- Spacebar: fire\n```\n\n## Gifshot\n\n![Demo](https://i.imgur.com/Eqtse6G.gif)\n\n[![Blocker - Game play 1](https://raw.githubusercontent.com/jojoee/blocker/master/screenshot/play1.jpg \"Blocker - Game play 1\")](http://blocker.jojoee.com/)\n\n[![Blocker - Debug](https://raw.githubusercontent.com/jojoee/blocker/master/screenshot/debug.jpg \"Blocker - Debug\")](http://blocker.jojoee.com/)\n\n## Getting Started\n1. Install [Node.js](https://nodejs.org/en/)\n2. Install Nodemon Bower Gulp: `npm install -g nodemon yarn bower pm2`\n3. Install dependencies: `yarn \u0026\u0026 bower install`\n\n```\nBuild client side\n- dev: `yarn build.watch`\n- prod: `yarn build`\n```\n\n```\nStart server side\n- dev: `nodemon app.js --watch app.js`\n- prod: `pm2 start app.js`\n```\n\n## Note\n```\n1. Code guideline \u0026 Naming we use\n1.1 Base javascript style: [Airbnb](https://github.com/airbnb/javascript)\n1.2 Function should return only one type\n  e.g.\n  - getName: string, '' (default)\n  - getRandomInt: number, 0 (default)\n  - getPlayers: Array, [] (default)\n  - getPlayer: Object, {} (default)\n\n  except getIndex\n  e.g.\n  - getIndexOfPlayer: number, -1 (default)\n\n2. Naming\n- Function / scope variable: `camelCase`  \n- Global variable: `UPPERCASE`\n- Class: `PascalCase`\n\n3. Creature\n- Monster\n  - Zombie\n  - Machine\n  - Bat\n- Hero\n  - Player / Enemy\n\n4. Socket\n- Send to specific client: IO.sockets.connected[socketId].emit(EVENT_NAME, data);\n- Send to all clients: IO.emit(EVENT_NAME, data);\n- Send to all clients except newly created connection: socket.broadcast.emit(EVENT_NAME, data);\n\n5. Event flow\nAnything's related with `life` directly, is need to broadcast first then\ntake effect from subsequent request. (currently, there are only 2 events\n(move / fire) that can execute on client before broadcasting)\n\n6. CommonJs\n```\n\n## TODO\n- [ ] All game calculation should be calculated on server-side\n- [ ] Define structure of sending-object and response-object from server\n- [ ] Send player-event to server (not data-object)\n- [ ] Check `const` and `let` again\n- [ ] Make all functions functional\n- [ ] Remove all `eslint-disable-line`\n- [ ] Add `checkAlive` event: the player is already gone, but it's still in the game (cause from network issue)\n- [ ] Using [MessagePack](http://msgpack.org/) instead of JSON\n- [ ] Respawn delay\n- [ ] Redirect all pages to root (cause we only use root page)\n- [ ] Update bubble/message graphic, [1](http://www.html5gamedevs.com/topic/8837-speech-bubble-text-with-rectangle-as-background/)\n- [ ] Add deploy shell script\n- [ ] Day / Night system\n- [ ] Implement [Shields.io](https://shields.io/)\n- [x] minimap, [1](http://www.html5gamedevs.com/topic/14182-creating-a-mini-map-in-phaser/), [2](http://www.html5gamedevs.com/topic/14930-creating-a-mini-map-from-a-render-texture/), [3](https://gist.github.com/jafrmartins/73e1e344237c980f3707f2760835f0bf)\n- [ ] Responsive (support mobile / tablet user)\n- [ ] Support screen when resizing \n- [ ] HUD\n- [ ] Score board (Leader board)\n- [ ] Cache\n- [ ] Knockback when creature is hitted\n- [ ] Add test (TDD) with test-task-runner, [1](https://github.com/gulpjs/gulp/blob/master/docs/recipes/mocha-test-runner-with-gulp.md)\n- [ ] QA - Analysis / Optimize / Profiling / ETC (e.g. sonarqube)\n- [ ] Sound\n- [ ] Effect / Screen transition / Screen shake\n- [ ] Fix - Creature is damaged and welled in the same time\n- [ ] Arrow / Laser is killed when hit stoneGroup\n- [ ] Room / Channel (able to create private room), [1](https://divillysausages.com/2015/07/12/an-intro-to-socket-io/), [2](http://www.tamas.io/advanced-chat-using-node-js-and-socket-io-episode-1/), [3](https://www.joezimjs.com/javascript/plugging-into-socket-io-advanced/)\n- [ ] Add social meta / share\n- [ ] Bot player\n- [ ] Tween: player move\n- [ ] Hero can collect item in the floor\n- [ ] Other class (e.g. Swordsman)\n- [ ] Monster path finder, [1](http://jojoee.github.io/phaser-examples/games/paths-face/), [2](http://jojoee.github.io/phaser-examples/games/boids-steering/), [3](http://jojoee.github.io/phaser-examples/games/easystarjs/)\n- [ ] Creature sight feature, [1](http://jojoee.github.io/phaser-examples/games/bresenham-light/), [2](http://www.emanueleferonato.com/wp-content/uploads/2014/10/survival/), [3](http://jojoee.github.io/phaser-examples/games/horror-ray-casting/)\n- [ ] Monster walk - random walk\n- [ ] Monster can be fired, welled\n- [ ] Talkable monster\n- [ ] Tween: monster move\n\n## Reference \u0026 Tutorial \u0026 Plugin \u0026 Tool\n- Inspired by [Blocker](http://blockergame.com/)\n- [phaser-multiplayer-game](https://github.com/xicombd/phaser-multiplayer-game)\n- [phaser-screen-shake](https://github.com/dmaslov/phaser-screen-shake)\n- [Text to ASCII Art Generator (TAAG)](http://patorjk.com/software/taag/)\n- [phaser-state-transition](phaser-state-transition-plugin)\n- [Tiled Map Editor](http://www.mapeditor.org/)\n\n### Multiplayer\n- Introduction to development of multiplayer HTML5 games (with Socket.io) [1](http://www.slideshare.net/Lotti86/introduction-to-multiplayer-game-development), [2](https://github.com/Lotti/codemotion2015)\n\n### Data structure\n- Generate id, [1](http://stackoverflow.com/questions/24041220/sending-message-to-a-specific-id-in-socket-io-1-0/), [2](http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript), [3](https://github.com/dylang/shortid), [4](https://github.com/broofa/node-uuid)\n- [Remove / Generate client id](http://stackoverflow.com/questions/7702461/socket-io-custom-client-id)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojoee%2Fblocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjojoee%2Fblocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojoee%2Fblocker/lists"}