diff --git a/README.md b/README.md index ecdfe98..e127768 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,21 @@ # Paper.IO -This is a clone of the original Paper-IO released by Voodoo, except for one aspect. This will attempt to implement a multi-player aspect of the game (like a real IO game). Currently this has a playground at this [link](https://thekidofarcrania.github.io/BlocklyIO). It's a demo version of what to come. Hopefully by that time, the necessary server infrastructure could be obtained. +> This is a clone of the original Paper-IO released by Voodoo, except for one aspect. This will attempt to implement a multi-player aspect of the game (like a real IO game). Currently this has a playground at this [link](https://thekidofarcrania.github.io/BlocklyIO). It's a demo version of what to come. Hopefully by that time, the necessary server infrastructure could be obtained. -This is just a fun side-project for me. If you would want to use this code, it would be nice to let me know. +> This is just a fun side-project for me. If you would want to use this code, it would be nice to let me know. + +## Screenshots + +![Screenshot](screenshot.png) ## Install ```bash +# Clone this repository git clone https://github.com/stevenjoezhang/paper.io.git +# Go into the repository cd paper.io +# Install dependencies npm install ``` @@ -22,7 +29,7 @@ npm start You can configure the game by editing `config.json`. -**WARNING: Remember to BUILD AGAIN after editing ANY FILE, INCLUDE `config.json`.** +**WARNING: Remember to build again after editing any file, include `config.json`.** ## Build @@ -51,9 +58,6 @@ node bot.js ws://localhost:8080 ## License -This is licensed under MIT. As such, please provide due credit and link back to this repository if possible. +This repo is forked from [BlocklyIO](https://github.com/theKidOfArcrania/BlocklyIO) by theKidOfArcrania. -Original Repo: - -- Author: theKidOfArcrania -- Link: https://github.com/theKidOfArcrania/BlocklyIO +> This is licensed under MIT. As such, please provide due credit and link back to this repository if possible. diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..a149a08 Binary files /dev/null and b/screenshot.png differ diff --git a/src/game-server.js b/src/game-server.js index 2b73ec6..f758f19 100644 --- a/src/game-server.js +++ b/src/game-server.js @@ -225,7 +225,7 @@ function gridSerialData(grid, players) { function findEmpty(grid) { var available = []; - for (var r = 1; r < grid.size - 1; r++) + for (var r = 1; r < grid.size - 1; r++) { for (var c = 1; c < grid.size - 1; c++) { var cluttered = false; checkclutter: for (var dr = -1; dr <= 1; dr++) { @@ -241,6 +241,7 @@ function findEmpty(grid) { col: c }); } + } return (available.length === 0) ? null : available[Math.floor(available.length * Math.random())]; } module.exports = Game;