@pinkaphant/create-kolmo 0.4.2 → 0.5.2
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 +56 -17
- package/bin/create-kolmo.mjs +20 -12
- package/package.json +1 -1
- package/templates/demolition/README.md +17 -0
- package/templates/demolition/index.html +29 -0
- package/templates/demolition/package.json +39 -0
- package/templates/demolition/src/App.tsx +599 -0
- package/templates/{lonedrive → demolition}/tsconfig.json +4 -2
- package/templates/{lonedrive → demolition}/vite.config.ts +3 -1
- package/templates/dust/README.md +9 -1
- package/templates/dust/index.html +15 -1
- package/templates/dust/package.json +10 -8
- package/templates/dust/src/App.tsx +106 -122
- package/templates/dust/tsconfig.json +4 -2
- package/templates/evolution/README.md +15 -0
- package/templates/evolution/index.html +29 -0
- package/templates/{lonedrive → evolution}/package.json +10 -9
- package/templates/evolution/src/App.tsx +619 -0
- package/templates/evolution/src/main.tsx +10 -0
- package/templates/evolution/src/styles.css +237 -0
- package/templates/evolution/tsconfig.json +16 -0
- package/templates/evolution/vite.config.ts +10 -0
- package/templates/longline/README.md +16 -9
- package/templates/longline/index.html +26 -12
- package/templates/longline/package.json +13 -11
- package/templates/longline/src/App.tsx +191 -42
- package/templates/longline/src/highway.ts +222 -0
- package/templates/longline/src/main.tsx +7 -6
- package/templates/longline/tsconfig.json +14 -16
- package/templates/longline/vite.config.ts +5 -23
- package/templates/road/README.md +8 -4
- package/templates/road/index.html +15 -1
- package/templates/road/package.json +7 -7
- package/templates/road/src/App.tsx +21 -6
- package/templates/road/tsconfig.json +1 -0
- package/templates/tugline/README.md +16 -0
- package/templates/tugline/index.html +31 -0
- package/templates/tugline/package.json +41 -0
- package/templates/tugline/src/App.tsx +48 -0
- package/templates/{longline → tugline}/src/components/Boat.tsx +1 -2
- package/templates/{longline → tugline}/src/components/Crates.tsx +2 -2
- package/templates/tugline/src/components/Hud.tsx +281 -0
- package/templates/{longline → tugline}/src/components/Longline.tsx +2 -2
- package/templates/{longline → tugline}/src/components/Ocean.tsx +14 -3
- package/templates/{longline → tugline}/src/components/Radar.tsx +15 -14
- package/templates/{longline → tugline}/src/components/Referee.tsx +6 -4
- package/templates/{longline → tugline}/src/components/Scene.tsx +10 -9
- package/templates/{longline → tugline}/src/components/Sky.tsx +14 -8
- package/templates/{longline → tugline}/src/game/store.test.ts +2 -2
- package/templates/{longline → tugline}/src/game/store.ts +38 -19
- package/templates/tugline/src/main.tsx +13 -0
- package/templates/tugline/src/styles.css +495 -0
- package/templates/tugline/tsconfig.json +18 -0
- package/templates/tugline/vite.config.ts +16 -0
- package/templates/lonedrive/README.md +0 -11
- package/templates/lonedrive/index.html +0 -15
- package/templates/lonedrive/src/App.tsx +0 -149
- package/templates/longline/src/components/Hud.tsx +0 -197
- package/templates/longline/src/styles.css +0 -367
- /package/templates/{lonedrive → demolition}/src/main.tsx +0 -0
- /package/templates/{longline → tugline}/src/components/CameraRig.tsx +0 -0
- /package/templates/{longline → tugline}/src/components/ocean-material.ts +0 -0
- /package/templates/{longline → tugline}/src/components/round-context.ts +0 -0
- /package/templates/{longline → tugline}/src/game/boat-control.ts +0 -0
- /package/templates/{longline → tugline}/src/game/constants.ts +0 -0
- /package/templates/{longline → tugline}/src/game/input.test.ts +0 -0
- /package/templates/{longline → tugline}/src/game/input.ts +0 -0
- /package/templates/{longline → tugline}/src/game/logic.test.ts +0 -0
- /package/templates/{longline → tugline}/src/game/logic.ts +0 -0
- /package/templates/{longline → tugline}/src/game/physics.test.ts +0 -0
- /package/templates/{longline → tugline}/src/game/radar.ts +0 -0
- /package/templates/{longline → tugline}/src/game/registry.ts +0 -0
- /package/templates/{longline → tugline}/src/game/sea.ts +0 -0
- /package/templates/{longline → tugline}/src/game/session.ts +0 -0
- /package/templates/{longline → tugline}/src/game/simulation.test.ts +0 -0
- /package/templates/{longline → tugline}/src/game/simulation.ts +0 -0
- /package/templates/{longline → tugline}/src/game/test-world.ts +0 -0
- /package/templates/{longline → tugline}/src/sfx.ts +0 -0
package/README.md
CHANGED
|
@@ -1,41 +1,80 @@
|
|
|
1
1
|
# `@pinkaphant/create-kolmo`
|
|
2
2
|
|
|
3
|
-
Scaffold a playable
|
|
4
|
-
|
|
5
|
-
## Longline, the tugboat
|
|
3
|
+
Scaffold a playable `@pinkaphant/kolmo` + `@khr3/core` 3D physics game with React 19, TypeScript, Vite, and Rapier WASM ([`./bin/create-kolmo.mjs`](./bin/create-kolmo.mjs)).
|
|
6
4
|
|
|
7
5
|
```bash
|
|
8
|
-
npm create @pinkaphant/kolmo@latest my-
|
|
9
|
-
cd my-
|
|
6
|
+
npm create @pinkaphant/kolmo@latest my-game -- --template road
|
|
7
|
+
cd my-game
|
|
10
8
|
npm run dev
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
Pass `--template <name>` to pick any of the 6 templates (`road` is the default; `--template lonedrive` aliases to `longline`). Add `--no-install` (or `--skip-install`) to skip `npm install`.
|
|
12
|
+
|
|
13
|
+
## Templates
|
|
14
|
+
|
|
15
|
+
### 1. `road` — Spline Road & C12 Village Sandbox ([`./templates/road`](./templates/road))
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm create @pinkaphant/kolmo@latest my-road-game
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Default template. Generates a seeded `@khr3/roads` continuous spline (`<RoadRibbon>`), grades a `384 m` terrain pad, places a cyclotomic `@khr3/c12` `planSettlement` village (`<Settlement>` with Rapier revolute-hinged doors), spawns a spline-aligned Skyline R34 (`computeSplineSpawnPose`), and mounts `<Actor>`, `<Toolgun>`, `<Hud>`, `<Radar>`, and `<Game dropSpawn>` `.glb` drop-to-drive.
|
|
22
|
+
|
|
23
|
+
- **WASD** / **Arrows**: Move or drive · **Shift**: Run / boost · **Space**: Jump · **C**: Brake
|
|
24
|
+
- **E** / **F**: Board or exit vehicle · **R**: Flip vehicle upright
|
|
25
|
+
- **V**: Toggle FPS / TPS camera · **L**: Toggle vehicle headlights · **N**: Cycle day / dusk / night sky
|
|
26
|
+
- **O** or drag-and-drop `.glb`: Auto-rig, spawn, and board any car `.glb` · **T** / right-click: Spawn armed asset
|
|
14
27
|
|
|
15
|
-
|
|
28
|
+
### 2. `tugline` — Gerstner Sea Tugboat & Tow-Line Arcade ([`./templates/tugline`](./templates/tugline))
|
|
16
29
|
|
|
17
30
|
```bash
|
|
18
|
-
npm create @pinkaphant/kolmo@latest my-
|
|
31
|
+
npm create @pinkaphant/kolmo@latest my-tugline -- --template tugline
|
|
19
32
|
```
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
90-second Gerstner ocean arcade game powered by `@pinkaphant/kolmo/water` and `@khr3/core` `<PhysicsWorld>`. Pilot a buoyant tugboat towing an 8-float rope line across `Calm`, `Choppy`, or `Rough` seas to lasso drifting cargo crates for up to `×5` combos, complete with headless Rapier hydrostatics tests (`npm test`).
|
|
35
|
+
|
|
36
|
+
- **W** / **S** or **Up** / **Down**: Ahead / astern · **A** / **D** or **Left** / **Right**: Port / starboard
|
|
37
|
+
- **1** / **2** / **3**: Select sea state (menu) · **Enter**: Start round · **Space**: Pause / resume · **R**: Restart round
|
|
22
38
|
|
|
23
|
-
|
|
39
|
+
### 3. `longline` — Endless `+Z` Desert Highway ([`./templates/longline`](./templates/longline))
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm create @pinkaphant/kolmo@latest my-longline -- --template longline
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Procedural infinite `+Z` desert highway inspired by *The Long Drive*. Streams `288 m` `@khr3/roads` highway spline and terrain chunks around the player's integer `Z` sector with bounded 9-chunk LRU eviction, places periodic roadside gas stations and swap vehicles, and tracks distance on a `tabular-nums` top odometer (`000.0 km`).
|
|
46
|
+
|
|
47
|
+
- **WASD** / **Arrows**: Walk or drive · **Shift**: Sprint / boost · **C** / **Space**: Brake
|
|
48
|
+
- **E** / **F**: Board or exit vehicle · **R**: Flip upright · **V**: FPS / TPS · **L**: Headlights · **N**: Sky · **O** / drop `.glb`: Import car
|
|
49
|
+
|
|
50
|
+
### 4. `dust` — Coastal Island, Buoyant Scrap Car & C12 Outpost ([`./templates/dust`](./templates/dust))
|
|
24
51
|
|
|
25
52
|
```bash
|
|
26
53
|
npm create @pinkaphant/kolmo@latest my-dust -- --template dust
|
|
27
54
|
```
|
|
28
55
|
|
|
29
|
-
|
|
56
|
+
Coastal island survival sandbox mounting `@pinkaphant/kolmo`'s `<Water>` Gerstner sea, a compact `@khr3/c12` coastal outpost (`<Settlement>`) + fuel depot registered in `<Radar>`, buoyant salvage props, and a surface-tangent (`computeSurfaceSpawnPose`) buoyant scrap hatchback.
|
|
30
57
|
|
|
31
|
-
|
|
58
|
+
- **WASD** / **Arrows**: Walk or drive · **E** / **F**: Board or exit · **V**: FPS / TPS · **L**: Headlights · **N**: Sky · **T** / right-click: Toolgun spawn
|
|
59
|
+
|
|
60
|
+
### 5. `demolition` — Full-Contact KHR Destructible Demolition Derby ([`./templates/demolition`](./templates/demolition))
|
|
32
61
|
|
|
33
62
|
```bash
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
npm create @pinkaphant/kolmo@latest my-derby -- --template demolition
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`128 m` sunken concave derby bowl with central spine mound and outer rim pit, powered by `@pinkaphant/kolmo/cars` (`compileKolmogorovCarBundle`, `DERBY_PANEL_ROLES`, `stepDerbyAutopilot`, `computeDerbyFitness`). Drive a boardable 4-byte KHR car with `6DOF` rocket boosters against 5 deterministic AI rivals as collision impulses unlatch, swing, and shear `KHR_physics_rigid_bodies` doors, hoods, gates, and bumpers into physical arena debris.
|
|
67
|
+
|
|
68
|
+
- **WASD** / **Arrows**: Drive · **Shift**: Fire `6DOF` boosters · **C** / **Space**: Brake · **E** / **F**: Exit or board any car
|
|
69
|
+
- **V**: FPS / TPS · **L**: Headlights · **N**: Sky · **R**: Upright (or **New Bout** button in top telemetry bar)
|
|
70
|
+
|
|
71
|
+
### 6. `evolution` — 4-Byte `uint32` BoxCar3D KHR Evolution Gauntlet ([`./templates/evolution`](./templates/evolution))
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm create @pinkaphant/kolmo@latest my-evolution -- --template evolution
|
|
37
75
|
```
|
|
38
76
|
|
|
39
|
-
|
|
77
|
+
Real-time 3D evolutionary car breeder on `@pinkaphant/kolmo/cars` (`createInitialPopulation`, `breedNextGeneration`, `computeGauntletFitness`, `exportKolmogorovCarGlb`). Races 8 simultaneous full-contact `<KhrVehicle>` genomes up a seeded `@khr3/roads` climb/mogul/jump gauntlet at `1x`/`2x`/`4x` physics speed, with live `0xXXXXXXXX` standings, hex gene injection, and one-click Khronos `.glb` export.
|
|
40
78
|
|
|
41
|
-
|
|
79
|
+
- **Click** any row in the standings dock to lock the `maath/easing` chase camera onto that genome
|
|
80
|
+
- **Space**: Pause / resume · **1** / **2** / **4**: Set simulation speed · **Inject Hex**: Splice custom `0xXXXXXXXX` gene · **Export .GLB**: Download selected KHR vehicle
|
package/bin/create-kolmo.mjs
CHANGED
|
@@ -3,6 +3,18 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
|
|
6
|
+
const CANONICAL_TEMPLATES = ["road", "tugline", "longline", "dust", "demolition", "evolution"];
|
|
7
|
+
|
|
8
|
+
const TEMPLATE_DIR = {
|
|
9
|
+
road: "road",
|
|
10
|
+
tugline: "tugline",
|
|
11
|
+
longline: "longline",
|
|
12
|
+
lonedrive: "longline",
|
|
13
|
+
dust: "dust",
|
|
14
|
+
demolition: "demolition",
|
|
15
|
+
evolution: "evolution",
|
|
16
|
+
};
|
|
17
|
+
|
|
6
18
|
const args = process.argv.slice(2);
|
|
7
19
|
let targetArg = "";
|
|
8
20
|
let skipInstall = false;
|
|
@@ -18,8 +30,8 @@ for (let i = 0; i < args.length; i++) {
|
|
|
18
30
|
template = a.slice("--template=".length);
|
|
19
31
|
} else if (a === "-h" || a === "--help") {
|
|
20
32
|
console.log(
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
`Usage: npm create @pinkaphant/kolmo@latest <project-dir> [--template ${CANONICAL_TEMPLATES.join("|")}] [--no-install|--skip-install]\n` +
|
|
34
|
+
` or: npx @pinkaphant/create-kolmo@latest <project-dir> [--template ${CANONICAL_TEMPLATES.join("|")}] [--no-install|--skip-install]`,
|
|
23
35
|
);
|
|
24
36
|
process.exit(0);
|
|
25
37
|
} else if (!a.startsWith("-") && !targetArg) {
|
|
@@ -30,18 +42,14 @@ for (let i = 0; i < args.length; i++) {
|
|
|
30
42
|
}
|
|
31
43
|
}
|
|
32
44
|
|
|
33
|
-
const TEMPLATE_DIR = {
|
|
34
|
-
road: "road",
|
|
35
|
-
longline: "longline",
|
|
36
|
-
lonedrive: "lonedrive",
|
|
37
|
-
dust: "dust",
|
|
38
|
-
};
|
|
39
|
-
|
|
40
45
|
if (!Object.hasOwn(TEMPLATE_DIR, template)) {
|
|
41
|
-
console.error(
|
|
46
|
+
console.error(
|
|
47
|
+
`Error: Unknown template "${template}". Available templates: ${CANONICAL_TEMPLATES.join(", ")} (alias: lonedrive -> longline).`,
|
|
48
|
+
);
|
|
42
49
|
process.exit(1);
|
|
43
50
|
}
|
|
44
51
|
|
|
52
|
+
const resolvedDir = TEMPLATE_DIR[template];
|
|
45
53
|
const dirName = targetArg || "kolmo-game";
|
|
46
54
|
const root = path.resolve(process.cwd(), dirName);
|
|
47
55
|
const pkgName = path
|
|
@@ -55,7 +63,7 @@ if (fs.existsSync(root) && fs.readdirSync(root).length > 0) {
|
|
|
55
63
|
process.exit(1);
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
const templateRoot = path.resolve(import.meta.dirname, "../templates",
|
|
66
|
+
const templateRoot = path.resolve(import.meta.dirname, "../templates", resolvedDir);
|
|
59
67
|
fs.cpSync(templateRoot, root, { recursive: true });
|
|
60
68
|
|
|
61
69
|
const templatePkgPath = path.join(root, "package.json");
|
|
@@ -71,7 +79,7 @@ if (fs.existsSync(indexHtmlPath)) {
|
|
|
71
79
|
|
|
72
80
|
fs.writeFileSync(path.join(root, ".gitignore"), "node_modules/\ndist/\n.DS_Store\n*.local\n");
|
|
73
81
|
|
|
74
|
-
console.log(`\nScaffolded Kolmo ${
|
|
82
|
+
console.log(`\nScaffolded Kolmo ${resolvedDir} project in ${root}`);
|
|
75
83
|
|
|
76
84
|
if (!skipInstall) {
|
|
77
85
|
console.log("Installing dependencies with npm...");
|
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Kolmo Demolition Derby
|
|
2
|
+
|
|
3
|
+
Full-contact `128 m` sunken concave KHR demolition derby bowl powered by `@pinkaphant/kolmo` and `@pinkaphant/kolmo/cars` ([`./src/App.tsx`](./src/App.tsx)).
|
|
4
|
+
|
|
5
|
+
Compiles 6 `uint32` Kolmogorov car genomes (`compileKolmogorovCarBundle`) with `6DOF` twin rocket boosters and 6 `KHR_physics_rigid_bodies` breakaway panels (`door_fl`, `door_fr`, `hood`, `rear_gate`, `bumper_front`, `bumper_rear`). Steps 5 deterministic AI brawlers (`stepDerbyAutopilot`) inside `useBeforePhysicsStep` and routes collision impulses into `applyImpactImpulse` so panels unlatch, swing, and shear off into arena debris.
|
|
6
|
+
|
|
7
|
+
- **WASD** / **Arrows**: Drive
|
|
8
|
+
- **Shift**: Fire `6DOF` rocket boosters
|
|
9
|
+
- **C** / **Space**: Brake
|
|
10
|
+
- **E** / **F**: Exit or board any vehicle in the bowl
|
|
11
|
+
- **R**: Flip piloted car upright (or deals a fresh bout when on foot)
|
|
12
|
+
- **B** / **NEW BOUT**: Deal a new seeded 6-car bout
|
|
13
|
+
- **V**: Toggle FPS / TPS camera · **L**: Toggle headlights · **N**: Cycle sky
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm create @pinkaphant/kolmo@latest my-derby -- --template demolition
|
|
17
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
6
|
+
<title>Kolmo Demolition</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Space+Grotesk:wght@500;600;700&display=swap"
|
|
11
|
+
rel="stylesheet"
|
|
12
|
+
/>
|
|
13
|
+
<style>
|
|
14
|
+
html, body, #root {
|
|
15
|
+
margin: 0;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
background: oklch(13.5% 0.007 265);
|
|
20
|
+
font-family: "Space Grotesk", system-ui, sans-serif;
|
|
21
|
+
font-variant-numeric: tabular-nums;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
<div id="root"></div>
|
|
27
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kolmo-demolition",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Demolition: 128 m sunken concave KHR demolition derby bowl with breakaway panels, 6DOF boosters, and deterministic AI rivals on @pinkaphant/kolmo.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"typecheck": "tsc --noEmit",
|
|
10
|
+
"build": "tsc --noEmit && vite build",
|
|
11
|
+
"preview": "vite preview"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@dimforge/rapier3d-compat": "0.19.2",
|
|
15
|
+
"@khr3/core": "^0.2.21",
|
|
16
|
+
"@pinkaphant/ecctrl": "2.0.4-beta.11",
|
|
17
|
+
"@pinkaphant/kolmo": "^0.15.1",
|
|
18
|
+
"@react-three/drei": "^10.7.7",
|
|
19
|
+
"@react-three/fiber": "^9.6.1",
|
|
20
|
+
"@react-three/rapier": "^2.2.0",
|
|
21
|
+
"koota": "^0.6.6",
|
|
22
|
+
"react": "^19.2.7",
|
|
23
|
+
"react-dom": "^19.2.7",
|
|
24
|
+
"three": "0.184.0"
|
|
25
|
+
},
|
|
26
|
+
"overrides": {
|
|
27
|
+
"@dimforge/rapier3d-compat": "0.19.2",
|
|
28
|
+
"@pinkaphant/ecctrl": "2.0.4-beta.11",
|
|
29
|
+
"three": "0.184.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/react": "^19.2.16",
|
|
33
|
+
"@types/react-dom": "^19.2.3",
|
|
34
|
+
"@types/three": "0.184.0",
|
|
35
|
+
"@vitejs/plugin-react": "^6.3.1",
|
|
36
|
+
"typescript": "^5.8.3",
|
|
37
|
+
"vite": "^8.4.1"
|
|
38
|
+
}
|
|
39
|
+
}
|