thrunium 1.2.0-rc.2 → 1.2.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -3
- package/dist/cli.mjs +373 -94
- package/dist/thrunium-global.mjs +1 -0
- package/dist/thrunium.js +1320 -67
- package/dist/thrunium.min.js +3 -2
- package/dist/thrunium.min.js.map +4 -4
- package/dist/types/button.d.ts +60 -0
- package/dist/types/collider.d.ts +4 -4
- package/dist/types/debug.d.ts +80 -0
- package/dist/types/font-string.d.ts +12 -0
- package/dist/types/fonts.d.ts +35 -0
- package/dist/types/game.d.ts +336 -15
- package/dist/types/input.d.ts +127 -0
- package/dist/types/internals.d.ts +14 -0
- package/dist/types/namespace.d.ts +2 -0
- package/dist/types/reference.d.ts +7 -1
- package/dist/types/sprite.d.ts +22 -0
- package/dist/types/timers.d.ts +18 -0
- package/package.json +1 -1
- package/templates/js/src/game.js +35 -0
- package/templates/ts/src/game.ts +35 -0
- package/templates/js/game.js +0 -17
- package/templates/ts/game.ts +0 -17
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ with a `/*! THRUNIUM v<version> | (c) Infobits ApS | MIT License */` banner and
|
|
|
34
34
|
The engine is also on npm as `thrunium` (Node 24 or newer):
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
npx thrunium init my-game # new TypeScript project; add --js for JavaScript
|
|
37
|
+
npx thrunium init my-game # new TypeScript project in src/game.ts; add --js for JavaScript
|
|
38
38
|
cd my-game && npm run dev # init installs for you; use pnpm dev, yarn dev or bun run dev
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -57,14 +57,25 @@ Commands (`thrunium --help`, `--version`):
|
|
|
57
57
|
|---|---|
|
|
58
58
|
| `thrunium dev` | `--port <n>` (default 3000, tries the next 10 ports if busy), `--host <name>` (default `localhost`), `--no-open` |
|
|
59
59
|
| `thrunium build` | `--out <dir>` (default `dist`), `--engine cdn\|bundle` |
|
|
60
|
-
| `thrunium init [dir]` | `--js` (TypeScript by default), `--pm npm\|pnpm\|yarn\|bun` (default: the one that ran it, else npm), `--no-install`; the folder must be empty. Installs by default; if that fails the project is kept and the command is printed |
|
|
60
|
+
| `thrunium init [dir]` | `--js` (TypeScript by default), `--no-src` (game file in the root instead of `src/`), `--pm npm\|pnpm\|yarn\|bun` (default: the one that ran it, else npm), `--no-install`; the folder must be empty. Installs by default; if that fails the project is kept and the command is printed |
|
|
61
61
|
|
|
62
62
|
A project needs no `index.html`: without one, `dev` and `build` generate the page
|
|
63
63
|
from `game.json` (`entry`, else the first of `game.ts`, `game.js`, `src/game.ts`,
|
|
64
64
|
`src/game.js`; the title is `name`, else the folder name). A hand-written
|
|
65
65
|
`index.html` is used as written, and having both it and `entry` is an error.
|
|
66
66
|
`import './style.css'` from game code is bundled and linked, with `url()` fonts and
|
|
67
|
-
images; remote `@import` stays remote.
|
|
67
|
+
images; remote `@import` stays remote. A generated page takes a title, description,
|
|
68
|
+
favicon, link-preview image, address and language from `page` in `game.json`, and
|
|
69
|
+
the contents of an optional `head.html` and `body.html` (see the "Dev server and
|
|
70
|
+
builds" guide). None of these mix with a hand-written `index.html`.
|
|
71
|
+
|
|
72
|
+
Games get keys and mouse state (`game.keys`, `game.mouse`), asset getters
|
|
73
|
+
(`game.image`, `game.sound`, `game.sprite`), declared fonts (`game.fonts`),
|
|
74
|
+
scenes with `game.paused`, timers (`game.after`, `game.every`), buttons
|
|
75
|
+
(`game.button`) and a debug menu (`game.debug`). `thrunium build` downloads
|
|
76
|
+
Google Fonts into the build, so players make no request to Google. See the
|
|
77
|
+
"Making games easier" guide. The debug menu is on under `thrunium dev` and off
|
|
78
|
+
in builds.
|
|
68
79
|
|
|
69
80
|
`dev` never uses the CDN. For a project with a module entry
|
|
70
81
|
(a generated page, or `<script type="module" src=...>` importing `thrunium`), `build` has two engine
|