TODO: Write intro
- Make sure you have a recent version of node.js installed
- Clone this repo
- Run
npm install
inside this repo - Run
npm start
to start the dev server - You should now be able to play the game at http://localhost:1234
The folder where all our source code (TypeScript) goes.
-
src/index.html
— This is the entrypoint to our code from the browser. This file then importssrc/game/index.tsx
which is the entrypoint to our typescript code. -
src/core/
— This is the engine code that I (Simon) have built up over many years and games. See src/core for more details about the engine. -
src/game/
This is where our game's code lives. Basically all the code you'll be writing will probably live in here. -
src/game/index.tsx
— The entrypoint for our TypeScript code on the page. All our code that runs can eventually be traced up to this file.
This is where our compiled game goes. You shouldn't need to poke around in here.
This is where all of our assets like images, sound effects, music, fonts, etc. go.
The build system watches this folder for added/removed files and generates .d.ts
files that make typescript aware that it can import these files. It also generates resources.ts
, which contains lists of all the resources that we use to automatically preload them.
resources/audio
— This is where all of our audio files go.resources/images
— This is where all of our images go.resources/fonts
— This is where all of our fonts go.
This game is built on an engine I have cobbled together over the years. There are a few big libraries in it that do the heavy lifting.
The code for this project is written in TypeScript, a superset of JavaScript that adds static type analysis.
This game uses a 2d rendering engine called Pixi.js.
This game uses a 2d physics engine called p2.js. It isn't the most performant or featureful engine, but the API is really simple, which is why I originally chose it. I'm hoping to replace it soon.
This project uses Parcel as the bundler and dev server. It handles everything with almost zero configuration and tends to just work. Hopefully you shouldn't have to mess with this.