diff --git a/README.md b/README.md index 27acccd..80194e9 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,26 @@ This is a stupid little game where you fly around and bump into asteroids and st ###Installation -Clone the Git repository, install node.js version 5.6.0 or higher then run `npm install` in the project directory. +Clone the Git repository, install Node.js version 5.6.0 or higher then run `npm install` in the project directory. + +Make sure that the command `node` links to this Node..js version and not `nodejs`. ###Running -Run `node index.js`. +Run `node index.js` or `npm start`. -Port 8080 must be open for people to play across the internet. +Port 8080 is used by default and this must be open for people to play across the internet. To use a different port, set the `process.env.PORT` variable. + +###Tests + +To run tests, use `npm test`. At the moment it doesn't test very much though but it can be useful to see if a player is at least able to connect without you having to go and open a browser tab. ###Controls -WASD to move, mouse to aim and shoot. +WASD to move. + +Mouse to aim and shoot. + +E/Q to change weapons. + +Enter to chat. diff --git a/server/interface.js b/server/interface.js index d39df48..2e0b098 100644 --- a/server/interface.js +++ b/server/interface.js @@ -17,6 +17,10 @@ class ServerInterface { } log(msg) { + if (!fs.existsSync('log')){ + fs.mkdirSync('log'); + } + let timestamp = this.timestamp; let output = msg; Array.from(arguments).splice(1).forEach(a => output = output[a]);