rename files

This commit is contained in:
StevenJoeZhang 2019-02-22 01:02:18 +08:00
parent 32449da6fb
commit 2cf9221ac2
8 changed files with 20 additions and 22 deletions

View File

@ -20,10 +20,12 @@ After cloning this repository, run the follow commands to install dependencies a
npm start npm start
``` ```
You can configure the game by editing `config.json`. Remember: DO NOT EDIT THE `consts` SETTINGS UNLESS YOU KNOW WHAT YOU ARE DOING.
## Bots ## Bots
```bash ```bash
node src/bot/paper-io-bot-mode.js ws://localhost:8081 node src/paper-io-bot.js ws://localhost:8081
``` ```
## Build ## Build
@ -35,9 +37,9 @@ browserify client.js | uglifyjs > public/bundle.js
## Roadmap & TODO List ## Roadmap & TODO List
[ ] 多个游戏房间 - [ ] 多个游戏房间
[ ] 加快渲染速度 - [ ] 加快渲染速度
[ ] 优化胜负判定 - [ ] 优化胜负判定
## License ## License
@ -46,5 +48,4 @@ This is licensed under MIT. As such, please provide due credit and link back to
Original Repo: Original Repo:
- Author: theKidOfArcrania - Author: theKidOfArcrania
- Link: https://github.com/theKidOfArcrania/BlocklyIO - Link: https://github.com/theKidOfArcrania/BlocklyIO

View File

@ -4,7 +4,7 @@ var io = require("socket.io-client");
var client = require("./src/game-client"); var client = require("./src/game-client");
var config = require("./config.json") var config = require("./config.json")
client.allowAnimation = true; client.allowAnimation = true;
client.renderer = require("./src/user-mode"); client.renderer = require("./src/mode/mode-user");
var mimiRequestAnimationFrame = window.requestAnimationFrame var mimiRequestAnimationFrame = window.requestAnimationFrame
|| window.webkitRequestAnimationFrame || window.webkitRequestAnimationFrame

View File

@ -3,8 +3,6 @@
"http_port": 8080, "http_port": 8080,
"ws_port": 8081, "ws_port": 8081,
"bots": [], "bots": [],
// DO NOT EDIT THE FOLLOWING SETTINGS
// UNLESS YOU KNOW WHAT YOU ARE DOING
"consts": { "consts": {
"GRID_SIZE": 80, "GRID_SIZE": 80,
"CELL_WIDTH": 40, "CELL_WIDTH": 40,

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
if (process.argv.length < 3) { if (process.argv.length < 3) {
console.log("Usage: node bot-mode.js <socket-url> [<name>]") console.log("Usage: node bot.js <socket-url> [<name>]")
process.exit(1); process.exit(1);
} }
@ -7,9 +7,9 @@ if (process.argv.length < 3) {
//TODO: add weight to the max land area and last land area, and also the number of kills //TODO: add weight to the max land area and last land area, and also the number of kills
//TODO: genetic gene pooling //TODO: genetic gene pooling
var core = require("../core"); var core = require("./core");
var client = require("../game-client"); var client = require("./game-client");
var consts = require("../../config.json").consts; var consts = require("../config.json").consts;
var MOVES = [[-1, 0], [0, 1], [1, 0], [0, -1]]; var MOVES = [[-1, 0], [0, 1], [1, 0], [0, -1]];

View File

@ -266,8 +266,7 @@ function update() {
invokeRenderer("update", [frame]); invokeRenderer("update", [frame]);
} }
//Export stuff //Export stuff
var funcs = [connectGame, changeHeading, getOthers, getPlayers, getUser]; [connectGame, changeHeading, getOthers, getPlayers, getUser].forEach(function(f) {
funcs.forEach(function(f) {
exports[f.name] = f; exports[f.name] = f;
}); });
exports.renderer = null; exports.renderer = null;

View File

@ -1,8 +1,8 @@
/* global $ */ /* global $ */
var core = require("./core"); var core = require("../core");
var client = require("./game-client"); var client = require("../game-client");
var consts = require("../config.json").consts; var consts = require("../../config.json").consts;
var SHADOW_OFFSET = 5; var SHADOW_OFFSET = 5;
var ANIMATE_FRAMES = 24; var ANIMATE_FRAMES = 24;

View File

@ -1,11 +1,11 @@
if (process.argv.length < 3) { if (process.argv.length < 3) {
console.log("Usage: node paper-io-bot-mode.js <socket-url> [<name>]") console.log("Usage: node paper-io-bot.js <socket-url> [<name>]")
process.exit(1); process.exit(1);
} }
var core = require("../core"); var core = require("./core");
var client = require("../game-client"); var client = require("./game-client");
var consts = require("../../config.json").consts; var consts = require("../config.json").consts;
var MOVES = [[-1, 0], [0, 1], [1, 0], [0, -1]]; var MOVES = [[-1, 0], [0, 1], [1, 0], [0, -1]];