diff --git a/README.md b/README.md index 9dbc06c..b1122b3 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,117 @@ # TS-Games -To install dependencies: +Custom framework/build system for simple single-file TypeScript games. + +## Installing dependencies + +- Install bun (https://bun.sh/) ```bash bun install ``` -To run: +## Make a game + +- Create your game folder in [src/games](src/games) +- Create `src/games//index.ts` with default exported function. + +## Running: ```bash bun start ``` +Navigate to `http://localhost:3000` to see the list of your games. +Game rebuilds on each reload. +## Building + +```bash +bun run build +``` +Will create `.html` in `dist` folder. + +Or to select project from list: + +```bash +bun run build +``` + +## Features + +- Bun ♥ +- TypeScript +- Building into single `.html` file without any dependencies, all assets are inlined as data-urls. + - `src/games//assets/favicon.ico` is used as page icon if present. + +- TSX supported with [Preact](https://preactjs.com/), because it's lightweight. + +- Import images as `HTMLImageElement` + - PNG & JPG + ```typescript + import spritesheet from './assets/spritesheet.png'; + console.log(spritesheet); // + ``` + +- Import audio as `HTMLAudioElement` + - WAV, MP3 & OGG + ```typescript + import heal from './assets/heal.ogg'; + console.log(heal); //