Skip to content

superdevgit/Ship-Battle-Game

Repository files navigation

Code name: Pirate-ship-battles

Code ClimateTest CoverageBuild Status

Online multiplayer game about pirates for USPGameDev

Summary

  1. Install dependencies
  2. Run server
  3. Server on the cloud
  4. Playing the game
  5. Unit testing

1. Install dependencies

To run PSB (Pirate Ship Battles) you will need node.js and yarn installed in your machine.

  1. To get node.js follow the instructions found here, the latest node version will be fine.
  2. For the yarn installation follow this guide right here.
  3. Make sure your node version is equal or higher than 8.0, to do that run :
node --version

Execute:

yarn install

2. Run server

  • Execute:
yarn serve
  1. This command will get the server up and run a bash script to minify the client .js files, thus getting a better load time.
yarn servep
  1. Will do the same as the previous command with the change that a python3 script will be used to minify, note the bash script is preferred.
yarn up
  1. This command is for the developers only, not changing anything about any file, just getting the server up.

3. Server on the cloud

If you are gonna use some webservice to run the server, run :

sudo nano /lib/systemd/system/pirates_game.service

Now, add

[Unit]
Description=pirates
After=network.target

[Service]
Environment=NODE_PORT=80
Type=simple
User=root
ExecStart=/usr/bin/yarn --cwd /home/ubuntu/pirates serve
Restart=on-failure

[Install]
WantedBy=multi-user.target

to the file and run :

sudo systemctl start pirates_game

4. Playing the game

5. Unit testing

We have tests!! Just run :

yarn test

And all our automated unit tests should run and help you see if something broke. We use Jest as our test API.

Any questions, please contact -@GuilhermeVieira.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published