/world-conflict

A multi-player, online, Risk-like strategy game. Implemented in Google App Script (i.e. Javascript).

Primary LanguageJavaScriptOtherNOASSERTION

World Conflict

A multi-player, online, Risk-like strategy game.

The original version was created for JS13k 2014 by Jakub Wasilewski. This project modifies that code in order to support multi-player online games using Google Apps Script (GAS). GAS is essentially Javascript which runs on a server.

Play the Google Apps Script version

Play the original version

Example Game

How to Run and Contribute

This is a Google Apps Script application. If you would like to contribute, first install CLASP. Next git clone this repository somewhere on your local machine.

This project uses Firestore to persist data. You will need your own instance to run. Firestore is free for low usage limits. Create an instance and put the private key in server/persistence/firestorePrivateKey.txt. This file should not be checked into git.

Now, from the WorldConflict directory within the cloned project directory, run the following commands (first time only):

  • clasp login using gmail account
  • clasp create --type webapp this creates a script with this name in your Google Drive after you do this, you will have a .clasp.json file locally with contents that look something like this
    {"scriptId":"13Py0mZIfz-mg5F7KA0HcUH9vL2g4Q8ep416zi6qJmMfD5CA9AUiZ969K"}
  • ./push.sh push all the files in the project directory into that script in the cloud. Note: you may need to do chmod +x first on this file if on *nix. Normally you would use clasp push, but this script will duplicate some files for use on client and server before dong the normal clasp push. Note: do not commit the files that get copied or generate.

Now you are good to go! Deploy the web-app from your script on Google Drive. Make changes locally (in IntelliJ for example), do ./push.sh (as described above), and refresh the deployed app script page to see the change. Do git commit, push, and create pull requests through Github when you have a feature or fix to contribute. If you do not actively use the project for a while, you may need to do the clasp login again.

Test

In order to run the unit tests, append ?test=true to the URL.

Thanks

Thanks to Jakub Wasilewski for the initial compact Javascript implementation of the game.