Playing the code on your computer

Every Star Soft game is just a folder of HTML and JavaScript files. You can download any finished game's code from its own page (under Download the code), to see how it was made or to play it on your own computer.

Each download contains the game plus the shared Star Soft engine it's built on, so it works on its own.

What you may do with the code

The code is shared under the Star Soft Non-Commercial Licence, and each zip includes a copy (LICENCE.txt). In short:

Step by step

Browsers only run games like these from a web server, so double-clicking index.html won't work. Live Server is a free, simple web server that runs inside Visual Studio Code on your own computer. You only need to install it once.

1. Unzip the download

  1. Find the zip file you downloaded (usually in your Downloads folder).
  2. On Windows, right-click it, choose Extract All…, then click Extract. On a Mac, double-click it.

2. Install Visual Studio Code

  1. Go to code.visualstudio.com and click the big Download button.
  2. Run the file you downloaded and click through the installer, keeping the settings it suggests.
  3. Open Visual Studio Code.

3. Install Live Server (once only)

  1. In Visual Studio Code, click the Extensions icon in the bar down the left-hand side (it looks like four small squares, one of them coming loose). Or press Ctrl+Shift+X (Cmd+Shift+X on a Mac).
  2. In the search box at the top of that panel, type Live Server.
  3. Click the one called Live Server by Ritwick Dey.
  4. Click the blue Install button. When it changes to say Uninstall (or shows a cog), Live Server is installed.

4. Open the game folder

  1. Click File → Open Folder… (on a Mac: File → Open…).
  2. Find the unzipped folder and go into it until you can see a file called index.html next to a folder called engine. (Windows sometimes puts the folder inside another folder with the same name, for example kingdom inside kingdom: go into the inner one.)
  3. Click Select Folder (or Open on a Mac).
  4. If Visual Studio Code asks Do you trust the authors of the files in this folder?, click Yes, I trust the authors.

5. Play with Live Server

  1. Click the Explorer icon at the top of the left-hand bar (it looks like two sheets of paper) to see the files.
  2. Right-click index.html and choose Open with Live Server. (Or click Go Live in the blue bar along the bottom of the window.)
  3. Your web browser opens the game's start page. Click PLAY.
  4. When you've finished, click Port : 5500 in the blue bar at the bottom to switch Live Server off.

Next time, just open Visual Studio Code, open the folder (File → Open Recent) and do step 5. Any other web server or web host works too.