Table of Contents

If you are interested in developing games with javascript/typescript, that can also run on the ClockworkPi Gameshell, this post might be for you. You can see my previous post for more information on the GSP.

You can find the resulting template/boilerplate code in my repository:

The result will look something like this:

Click to open in a new window.

Media ID: B6gixc7oDO9

Getting started

Install node/npm from (LTS).

Install nw from (SDK).

Make sure the commands npm and nw are available in your CLI.

I use Visual Studio Code from as a my IDE.

npm install
npm run build
npm run start

And you should see a small window with a bouncing DVD logo.

Stuff to read for the GameShell

This is the thread I looked at to find the info on how to run some Javascript based games on the GameShell:

The GSP Launcher came preinstalled on my GameShell, so there was not much to set up.

This also helped me get started:

This was a helpful reference to write the DVD Demo and understand PhaserJS:

Running this Project on the GameShell

As shown above, build this project with

npm run build

Preparing GSP

Connect to the GSP via SSH. I assume you are using a linux like environment as your desktop OS.

On my device, GSP was installed in /home/cpi/games/GSP/. The launcher reads a config file /home/cpi/games/GSP/GSPGames/menu.json, so you can add your own project there.

Add the entry:

	    "title": "DVD-Demo",
	    "directory": "dvd-demo/"

Then, create the folder:

mkdir /home/cpi/games/GSP/GSPGames/dvd-demo

Copy over the files

Then, copy over the files:

scp -r dist/* cpi@clockworkpi:/home/cpi/games/GSP/GSPGames/dvd-demo/

(Re)Start the GSP Launcher and select DVDDEMO from the menu.

Getting all 320x240 Pixels

The GSP default config hasn’t set the NWJS window to allow full screen. I changed the file /home/cpi/games/GSP/package.json to allow fullscreen, so the contents are as follow:

    "name": "GSPLauncher",
    "main": "index.html",
    "window": {
        "width": 320,
        "height": 240,
        "max_width": 320,
        "max_height": 240,
        "resizable": false,
        "fullscreen": true, // change this from false to true
        "frame": false,
        "transparent": true

In addidtion to this, I had to set overflow: hidden on the body tag. Then, you can use the full 320x240 canvas for PhaserJS (after restarting GSP).


Connect to your GameShell with

ssh -L 9222:localhost:9222 cpi@clockworkpi

Then, open


with the browser chrome. The developer console will open, and you can select the index.html to debug your project running on the gameshell.


I used the logo from Wikipedia to create the asset: