The great move >.<

This commit is contained in:
kolaflash committed 2026-02-05 22:26:34 +01:00
1 parent 175ea1b726
commit 083cb70fbe
90 files changed
+85 -137

No files matched your search

+14 -14
View File
@@ -54,23 +54,23 @@
"@babel/types": ["@babel/types@7.28.5", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA=="],
"@biomejs/biome": ["@biomejs/biome@2.3.11", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.3.11", "@biomejs/cli-darwin-x64": "2.3.11", "@biomejs/cli-linux-arm64": "2.3.11", "@biomejs/cli-linux-arm64-musl": "2.3.11", "@biomejs/cli-linux-x64": "2.3.11", "@biomejs/cli-linux-x64-musl": "2.3.11", "@biomejs/cli-win32-arm64": "2.3.11", "@biomejs/cli-win32-x64": "2.3.11" }, "bin": { "biome": "bin/biome" } }, "sha512-/zt+6qazBWguPG6+eWmiELqO+9jRsMZ/DBU3lfuU2ngtIQYzymocHhKiZRyrbra4aCOoyTg/BmY+6WH5mv9xmQ=="],
"@biomejs/biome": ["@biomejs/biome@2.3.14", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.3.14", "@biomejs/cli-darwin-x64": "2.3.14", "@biomejs/cli-linux-arm64": "2.3.14", "@biomejs/cli-linux-arm64-musl": "2.3.14", "@biomejs/cli-linux-x64": "2.3.14", "@biomejs/cli-linux-x64-musl": "2.3.14", "@biomejs/cli-win32-arm64": "2.3.14", "@biomejs/cli-win32-x64": "2.3.14" }, "bin": { "biome": "bin/biome" } }, "sha512-QMT6QviX0WqXJCaiqVMiBUCr5WRQ1iFSjvOLoTk6auKukJMvnMzWucXpwZB0e8F00/1/BsS9DzcKgWH+CLqVuA=="],
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.11", "", { "os": "darwin", "cpu": "arm64" }, "sha512-/uXXkBcPKVQY7rc9Ys2CrlirBJYbpESEDme7RKiBD6MmqR2w3j0+ZZXRIL2xiaNPsIMMNhP1YnA+jRRxoOAFrA=="],
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.3.14", "", { "os": "darwin", "cpu": "arm64" }, "sha512-UJGPpvWJMkLxSRtpCAKfKh41Q4JJXisvxZL8ChN1eNW3m/WlPFJ6EFDCE7YfUb4XS8ZFi3C1dFpxUJ0Ety5n+A=="],
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.3.11", "", { "os": "darwin", "cpu": "x64" }, "sha512-fh7nnvbweDPm2xEmFjfmq7zSUiox88plgdHF9OIW4i99WnXrAC3o2P3ag9judoUMv8FCSUnlwJCM1B64nO5Fbg=="],
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.3.14", "", { "os": "darwin", "cpu": "x64" }, "sha512-PNkLNQG6RLo8lG7QoWe/hhnMxJIt1tEimoXpGQjwS/dkdNiKBLPv4RpeQl8o3s1OKI3ZOR5XPiYtmbGGHAOnLA=="],
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.3.11", "", { "os": "linux", "cpu": "arm64" }, "sha512-l4xkGa9E7Uc0/05qU2lMYfN1H+fzzkHgaJoy98wO+b/7Gl78srbCRRgwYSW+BTLixTBrM6Ede5NSBwt7rd/i6g=="],
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.3.14", "", { "os": "linux", "cpu": "arm64" }, "sha512-KT67FKfzIw6DNnUNdYlBg+eU24Go3n75GWK6NwU4+yJmDYFe9i/MjiI+U/iEzKvo0g7G7MZqoyrhIYuND2w8QQ=="],
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.3.11", "", { "os": "linux", "cpu": "arm64" }, "sha512-XPSQ+XIPZMLaZ6zveQdwNjbX+QdROEd1zPgMwD47zvHV+tCGB88VH+aynyGxAHdzL+Tm/+DtKST5SECs4iwCLg=="],
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.3.14", "", { "os": "linux", "cpu": "arm64" }, "sha512-LInRbXhYujtL3sH2TMCH/UBwJZsoGwfQjBrMfl84CD4hL/41C/EU5mldqf1yoFpsI0iPWuU83U+nB2TUUypWeg=="],
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.3.11", "", { "os": "linux", "cpu": "x64" }, "sha512-/1s9V/H3cSe0r0Mv/Z8JryF5x9ywRxywomqZVLHAoa/uN0eY7F8gEngWKNS5vbbN/BsfpCG5yeBT5ENh50Frxg=="],
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.3.14", "", { "os": "linux", "cpu": "x64" }, "sha512-ZsZzQsl9U+wxFrGGS4f6UxREUlgHwmEfu1IrXlgNFrNnd5Th6lIJr8KmSzu/+meSa9f4rzFrbEW9LBBA6ScoMA=="],
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.3.11", "", { "os": "linux", "cpu": "x64" }, "sha512-vU7a8wLs5C9yJ4CB8a44r12aXYb8yYgBn+WeyzbMjaCMklzCv1oXr8x+VEyWodgJt9bDmhiaW/I0RHbn7rsNmw=="],
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.3.14", "", { "os": "linux", "cpu": "x64" }, "sha512-KQU7EkbBBuHPW3/rAcoiVmhlPtDSGOGRPv9js7qJVpYTzjQmVR+C9Rfcz+ti8YCH+zT1J52tuBybtP4IodjxZQ=="],
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.3.11", "", { "os": "win32", "cpu": "arm64" }, "sha512-PZQ6ElCOnkYapSsysiTy0+fYX+agXPlWugh6+eQ6uPKI3vKAqNp6TnMhoM3oY2NltSB89hz59o8xIfOdyhi9Iw=="],
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.3.14", "", { "os": "win32", "cpu": "arm64" }, "sha512-+IKYkj/pUBbnRf1G1+RlyA3LWiDgra1xpS7H2g4BuOzzRbRB+hmlw0yFsLprHhbbt7jUzbzAbAjK/Pn0FDnh1A=="],
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.11", "", { "os": "win32", "cpu": "x64" }, "sha512-43VrG813EW+b5+YbDbz31uUsheX+qFKCpXeY9kfdAx+ww3naKxeVkTD9zLIWxUPfJquANMHrmW3wbe/037G0Qg=="],
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.14", "", { "os": "win32", "cpu": "x64" }, "sha512-oizCjdyQ3WJEswpb3Chdngeat56rIdSYK12JI3iI11Mt5T5EXcZ7WLuowzEaFPNJ3zmOQFliMN8QY1Pi+qsfdQ=="],
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.27.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw=="],
@@ -192,7 +192,7 @@
"@types/babel__traverse": ["@types/babel__traverse@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],
"@types/bun": ["@types/bun@1.3.6", "", { "dependencies": { "bun-types": "1.3.6" } }, "sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA=="],
"@types/bun": ["@types/bun@1.3.8", "", { "dependencies": { "bun-types": "1.3.8" } }, "sha512-3LvWJ2q5GerAXYxO2mffLTqOzEu5qnhEAlh48Vnu8WQfnmSwbgagjGZV6BoHKJztENYEDn6QmVd949W4uESRJA=="],
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
@@ -206,7 +206,7 @@
"browserslist": ["browserslist@4.28.1", "", { "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", "electron-to-chromium": "^1.5.263", "node-releases": "^2.0.27", "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA=="],
"bun-types": ["bun-types@1.3.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ=="],
"bun-types": ["bun-types@1.3.8", "", { "dependencies": { "@types/node": "*" } }, "sha512-fL99nxdOWvV4LqjmC+8Q9kW3M4QTtTR1eePs94v5ctGqU8OeceWrSUaRw3JYb7tU3FkMIAjkueehrHPPPGKi5Q=="],
"caniuse-lite": ["caniuse-lite@1.0.30001763", "", {}, "sha512-mh/dGtq56uN98LlNX9qdbKnzINhX0QzhiWBFEkFfsFO4QyCvL8YegrJAazCwXIeqkIob8BlZPGM3xdnY+sgmvQ=="],
@@ -264,11 +264,11 @@
"semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
"seroval": ["seroval@1.3.2", "", {}, "sha512-RbcPH1n5cfwKrru7v7+zrZvjLurgHhGyso3HTyGtRivGWgYjbOmGuivCQaORNELjNONoK35nj28EoWul9sb1zQ=="],
"seroval": ["seroval@1.5.0", "", {}, "sha512-OE4cvmJ1uSPrKorFIH9/w/Qwuvi/IMcGbv5RKgcJ/zjA/IohDLU6SVaxFN9FwajbP7nsX0dQqMDes1whk3y+yw=="],
"seroval-plugins": ["seroval-plugins@1.3.3", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-16OL3NnUBw8JG1jBLUoZJsLnQq0n5Ua6aHalhJK4fMQkz1lqR7Osz1sA30trBtd9VUDc2NgkuRCn8+/pBwqZ+w=="],
"seroval-plugins": ["seroval-plugins@1.5.0", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-EAHqADIQondwRZIdeW2I636zgsODzoBDwb3PT/+7TLDWyw1Dy/Xv7iGUIEXXav7usHDE9HVhOU61irI3EnyyHA=="],
"solid-js": ["solid-js@1.9.10", "", { "dependencies": { "csstype": "^3.1.0", "seroval": "~1.3.0", "seroval-plugins": "~1.3.0" } }, "sha512-Coz956cos/EPDlhs6+jsdTxKuJDPT7B5SVIWgABwROyxjY7Xbr8wkzD68Et+NxnV7DLJ3nJdAC2r9InuV/4Jew=="],
"solid-js": ["solid-js@1.9.11", "", { "dependencies": { "csstype": "^3.1.0", "seroval": "~1.5.0", "seroval-plugins": "~1.5.0" } }, "sha512-WEJtcc5mkh/BnHA6Yrg4whlF8g6QwpmXXRg4P2ztPmcKeHHlH4+djYecBLhSpecZY2RRECXYUwIc/C2r3yzQ4Q=="],
"solid-refresh": ["solid-refresh@0.6.3", "", { "dependencies": { "@babel/generator": "^7.23.6", "@babel/helper-module-imports": "^7.22.15", "@babel/types": "^7.23.6" }, "peerDependencies": { "solid-js": "^1.3" } }, "sha512-F3aPsX6hVw9ttm5LYlth8Q15x6MlI/J3Dn+o3EQyRTtTxidepSTwAYdozt01/YA+7ObcciagGEyXIopGZzQtbA=="],
+1 -1
View File
@@ -1,4 +1,4 @@
import { drawSprite, type Sprite } from "#/lib/Sprite.ts";
import { drawSprite, type Sprite } from "./Sprite.ts";
export const spriteMap = new Map<string, Sprite>();
+2 -2
View File
@@ -1,5 +1,5 @@
import type { Animation } from "#/engine/Animation.ts";
import { createVector, type Vector } from "#/lib/Vector.ts";
import type { Animation } from "./Animation.ts";
import { createVector, type Vector } from "./Vector.ts";
export type Indirect = never;
View File
File renamed without changes.
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Vector } from "#/lib/Vector.ts";
import type { Vector } from "./Vector.ts";
import { viewport } from "./Viewport.ts";
export type Pointer = {
+5 -5
View File
@@ -6,9 +6,9 @@ import {
entityProcessMap,
type Indirect,
type Process as ProcessEntity,
} from "#/engine/Entity.ts";
import { useWithAsyncCache } from "#/lib/cache.ts";
import { type Graph, getNeighbours } from "#/lib/Graph.ts";
} from "./Entity.ts";
import { type Graph, getNeighbours } from "./Graph.ts";
import { useWithAsyncCache } from "./lib/cache.ts";
export type SceneData = {
name: string;
@@ -50,7 +50,7 @@ const sceneInstancesMap = new Map<string, Array<Entity<unknown>>>();
export const [loadScene, sceneCache] = useWithAsyncCache(
async (name: string) => {
await import(`#/scenes/${name}/scene.ts`);
await import(`#/game/scenes/${name}/scene.ts`);
const data = sceneDataMap.get(name)!;
const entityInstanceMap = sceneEntiyMap.get(name)!;
@@ -58,7 +58,7 @@ export const [loadScene, sceneCache] = useWithAsyncCache(
await Promise.all(
data.entities.map(async (entity: Entity<unknown>) => {
await import(`#/entities/${entity.name}/entity.ts`);
await import(`#/game/entities/${entity.name}/entity.ts`);
if (!entityInstanceMap.has(entity.name)) {
entityInstanceMap.set(entity.name, {
+1 -1
View File
@@ -1,4 +1,4 @@
import { lerp } from "./lerp.ts";
import { lerp } from "./lib/lerp.ts";
import type { Vector } from "./Vector.ts";
export type Segment = [Vector, Vector];
+1 -1
View File
@@ -1,4 +1,4 @@
import { loadImage } from "./loadImage.ts";
import { loadImage } from "./lib/loadImage.ts";
export type Sprite = {
image: HTMLImageElement;
View File
File renamed without changes.
+1 -1
View File
@@ -1,4 +1,4 @@
import { createVector, type Vector } from "#/lib/Vector.ts";
import { createVector, type Vector } from "./Vector.ts";
export type Viewport = {
scale: number;
File renamed without changes.
@@ -6,9 +6,9 @@ import {
For,
Show,
} from "solid-js";
import { FileIcon } from "#/dev/icons/File.tsx";
import { FolderIcon } from "#/dev/icons/Folder.tsx";
import { FolderOpenIcon } from "#/dev/icons/FolderOpen.tsx";
import { FileIcon } from "./icons/File.tsx";
import { FolderIcon } from "./icons/Folder.tsx";
import { FolderOpenIcon } from "./icons/FolderOpen.tsx";
export type BrowserFile = {
path: string;
File renamed without changes.
@@ -1,20 +1,20 @@
import "./GraphBrowser.css";
import { type Component, createSignal, onMount } from "solid-js";
import { currentScene } from "#/engine/Scene.ts";
import {
type Edge,
type Graph,
getNeighbours,
type Node,
} from "#/lib/Graph.ts";
import { mulberry32 } from "#/lib/mulberry32.ts";
} from "#/engine/Graph.ts";
import { mulberry32 } from "#/engine/lib/mulberry32.ts";
import { currentScene } from "#/engine/Scene.ts";
import {
createVector,
getDistance,
scale,
setDistanceNormal,
type Vector,
} from "#/lib/Vector.ts";
} from "#/engine/Vector.ts";
type PhysicsPartial = {
position: Vector;
File renamed without changes.
+4 -4
View File
@@ -10,10 +10,10 @@ import {
type Signal,
Switch,
} from "solid-js";
import { ArrowNarrowDownIcon } from "#/dev/icons/ArrowNarrowDown.tsx";
import { ArrowNarrowUpIcon } from "#/dev/icons/ArrowNarrowUp.tsx";
import { ArrowsSortIcon } from "#/dev/icons/ArrowsSort.tsx";
import { ChevronDownIcon } from "#/dev/icons/ChevronDown.tsx";
import { ArrowNarrowDownIcon } from "./icons/ArrowNarrowDown.tsx";
import { ArrowNarrowUpIcon } from "./icons/ArrowNarrowUp.tsx";
import { ArrowsSortIcon } from "./icons/ArrowsSort.tsx";
import { ChevronDownIcon } from "./icons/ChevronDown.tsx";
export type ListItem = { label: string; isActive: boolean };
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
import type { BrowserFolder } from "#/dev/FileBrowser.tsx";
import type { BrowserFolder } from "./FileBrowser.tsx";
export async function fetchBrowserData(dir: string): Promise<BrowserFolder> {
const indexRef: string[] = await (await fetch(`/api/${dir}`)).json();
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+11 -11
View File
@@ -7,16 +7,7 @@ import {
Show,
} from "solid-js";
import { render } from "solid-js/web";
import { InputField } from "#/dev/controls/InputField.tsx";
import { RangeSlider } from "#/dev/controls/RangeSlider.tsx";
import { ItemList, type ItemsRef } from "#/dev/ItemList.tsx";
import { ArrowAutofitHeightIcon } from "#/dev/icons/ArrowAutofitHeight.tsx";
import { ArrowAutofitWidthIcon } from "#/dev/icons/ArrowAutofitWidth.tsx";
import { FileIcon } from "#/dev/icons/File.tsx";
import { LetterXIcon } from "#/dev/icons/LetterX.tsx";
import { LetterYIcon } from "#/dev/icons/LetterY.tsx";
import { ZoomScanIcon } from "#/dev/icons/ZoomScan.tsx";
import { type Animation, spriteMap } from "#/engine/Animation.ts";
import { spriteMap } from "#/engine/Animation.ts";
import type { Entity } from "#/engine/Entity.ts";
import {
currentScene,
@@ -27,7 +18,16 @@ import {
setScene,
} from "#/engine/Scene.ts";
import { setScale, viewport } from "#/engine/Viewport.ts";
import { InputField } from "./controls/InputField.tsx";
import { RangeSlider } from "./controls/RangeSlider.tsx";
import { GraphBrowser } from "./GraphBrowser.tsx";
import { ItemList, type ItemsRef } from "./ItemList.tsx";
import { ArrowAutofitHeightIcon } from "./icons/ArrowAutofitHeight.tsx";
import { ArrowAutofitWidthIcon } from "./icons/ArrowAutofitWidth.tsx";
import { FileIcon } from "./icons/File.tsx";
import { LetterXIcon } from "./icons/LetterX.tsx";
import { LetterYIcon } from "./icons/LetterY.tsx";
import { ZoomScanIcon } from "./icons/ZoomScan.tsx";
async function fetchScenes(): Promise<string[]> {
const indexRef: string[] = await (await fetch(`/api/scenes`)).json();
@@ -192,7 +192,7 @@ const DevTools: Component<{ gameContainer: HTMLElement }> = ({
</div>
<ItemList name="Scenes" handler={setCurrentScene} items={scenes} />
<GraphBrowser graph={sceneGraph} seed={1300346452} />
<GraphBrowser graph={sceneGraph} seed={2802446152} />
<ItemList name="Entities" handler={selectEntity} items={entities} />
@@ -1,5 +1,6 @@
import { readdirSync, writeFileSync } from "node:fs";
import type { IncomingMessage, ServerResponse } from "node:http";
import { root } from "../../../vite.config.ts";
function buildBrowserIndex(dir: string): string[] {
const dirents = readdirSync(dir, {
@@ -10,11 +11,19 @@ function buildBrowserIndex(dir: string): string[] {
return dirents
.filter((dirent) => dirent.isFile())
.map((dirent) => {
const path = dirent.parentPath.substring(dir.length);
const path = dirent.parentPath.substring(dir.length - 1);
return `${path}/${dirent.name}`;
});
}
function getScenes(req: IncomingMessage, res: ServerResponse) {
const sceneData = buildBrowserIndex(`${root}/game/scenes`);
res.writeHead(200, { "Content-Type": "application/json" });
res.end(JSON.stringify(sceneData));
}
function get(req: IncomingMessage, res: ServerResponse): void {
const match = req.url?.match(/^\/(\w+)$/);
if (!match) {
@@ -24,10 +33,12 @@ function get(req: IncomingMessage, res: ServerResponse): void {
return;
}
const sceneData = buildBrowserIndex(match[1]);
res.writeHead(200, { "Content-Type": "application/json" });
res.end(JSON.stringify(sceneData));
switch (req.url) {
case "/scenes": {
getScenes(req, res);
break;
}
}
}
function post(req: IncomingMessage, res: ServerResponse): void {
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
-29
View File
@@ -1,29 +0,0 @@
import { createAnimation, playAnimation } from "#/engine/Animation.ts";
import { defineEntity } from "#/engine/Entity.ts";
import { fromSrc, type Sprite } from "#/lib/Sprite.ts";
const idle: Sprite = await fromSrc("/assets/hero/idle.png", 5, 4);
const { animate, process } = defineEntity("barEntity", {
animation: createAnimation(idle, 200, 0),
stuff: 1,
});
animate((entity, ctx, delta) => {
playAnimation(
ctx,
entity.animation,
entity.position.x,
entity.position.y,
delta,
);
});
process((entity, delta) => {
entity.position.x += entity.stuff * 0.5;
if (entity.position.x > 64) {
entity.stuff = -1;
} else if (entity.position.x < 0) {
entity.stuff = 1;
}
});
File renamed without changes.

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 551 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 700 B

After

Width:  |  Height:  |  Size: 700 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

File renamed without changes.
File renamed without changes.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 815 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 842 B

After

Width:  |  Height:  |  Size: 842 B

@@ -1,9 +1,9 @@
import charIdle from "#/assets/char-idle.png";
import { createAnimation, playAnimation } from "#/engine/Animation.ts";
import { defineEntity } from "#/engine/Entity.ts";
import { keyboardInput } from "#/engine/Keyboard.ts";
import { pointer } from "#/engine/Pointer.ts";
import { fromSrc, type Sprite } from "#/lib/Sprite.ts";
import { fromSrc, type Sprite } from "#/engine/Sprite.ts";
import charIdle from "#/game/assets/char-idle.png";
const idle: Sprite = await fromSrc(charIdle, 2, 4);
@@ -1,8 +1,9 @@
import { createAnimation, playAnimation } from "#/engine/Animation.ts";
import { defineEntity } from "#/engine/Entity.ts";
import { fromSrc, type Sprite } from "#/lib/Sprite.ts";
import { fromSrc, type Sprite } from "#/engine/Sprite.ts";
import portal from "#/game/assets/portal.png";
const sprite: Sprite = await fromSrc("./assets/portal.png", 3, 1);
const sprite: Sprite = await fromSrc(portal, 3, 1);
const { animate } = defineEntity("portal", {
animation: createAnimation(sprite, 400, 0),
@@ -1,14 +1,14 @@
import charIdle from "#/assets/char-idle.png";
import charWalk from "#/assets/char-walk.png";
import {
type Animation,
createAnimation,
playAnimation,
} from "#/engine/Animation.ts";
import { defineEntity } from "#/engine/Entity.ts";
import { loadImage } from "#/engine/lib/loadImage.ts";
import { createSprite } from "#/engine/Sprite.ts";
import { viewport } from "#/engine/Viewport.ts";
import { loadImage } from "#/lib/loadImage.ts";
import { createSprite } from "#/lib/Sprite.ts";
import charIdle from "#/game/assets/char-idle.png";
import charWalk from "#/game/assets/char-walk.png";
const sprites = {
idle: createSprite(await loadImage(charIdle), 2, 4),
@@ -9,13 +9,6 @@
"x": 0,
"y": 0
}
},
{
"name": "barEntity",
"position": {
"x": 24,
"y": 16
}
}
]
}
File renamed without changes.
@@ -11,7 +11,7 @@
}
},
{
"name": "hero",
"name": "testEntity",
"position": {
"x": 24,
"y": 16
File renamed without changes.
File renamed without changes.
@@ -1,11 +1,11 @@
import { pointer } from "#/engine/Pointer.ts";
import { defineScene } from "#/engine/Scene.ts";
import type { Vector } from "#/lib/Vector.ts";
import type { Vector } from "#/engine/Vector.ts";
import data from "./data.json";
const { process, preProcess, linkScenes } = defineScene(data);
linkScenes(["fooScene", "fuzzScene"] as const);
linkScenes(["fooScene"] as const);
preProcess((entityInstanceMap) => {
const entity = entityInstanceMap.get(data.entities[0].name);
+2 -2
View File
@@ -1,3 +1,4 @@
import { listenKeyboard } from "#/engine/Keyboard.ts";
import { listenPointer } from "#/engine/Pointer.ts";
import { currentScene, setScene } from "#/engine/Scene.ts";
import {
@@ -6,7 +7,6 @@ import {
resizeCanvas,
viewport,
} from "#/engine/Viewport.ts";
import { listenKeyboard } from "./engine/Keyboard.ts";
let then = self.performance.now();
let delta = 0;
@@ -21,7 +21,7 @@ function animate(timestamp: number): void {
(async () => {
if (import.meta.env.DEV) {
import("#/dev/main.tsx").then((m) => m.use(viewport.gameContainer));
import("#/engine/dev/main").then((m) => m.use(viewport.gameContainer));
}
initViewport();
+3 -3
View File
@@ -6,10 +6,10 @@
"check": "biome check --write"
},
"devDependencies": {
"@biomejs/biome": "2.3.11",
"@types/bun": "1.3.6",
"@biomejs/biome": "2.3.14",
"@types/bun": "1.3.8",
"lz-string": "1.5.0",
"solid-js": "1.9.10",
"solid-js": "1.9.11",
"vite": "7.3.1",
"vite-plugin-solid": "2.11.10"
},
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 815 B

-21
View File
@@ -1,21 +0,0 @@
{
"name": "fuzzScene",
"width": 240,
"height": 160,
"entities": [
{
"name": "barEntity",
"position": {
"x": 0,
"y": 0
}
},
{
"name": "barEntity",
"position": {
"x": 24,
"y": 16
}
}
]
}
-8
View File
@@ -1,8 +0,0 @@
import { defineScene } from "#/engine/Scene.ts";
import data from "./data.json";
const { process, linkScenes } = defineScene(data);
linkScenes(["testScene"] as const);
process((_ctx, _delta) => {});
+3 -2
View File
@@ -1,10 +1,11 @@
import { fileURLToPath, URL } from "node:url";
import { defineConfig, type Plugin } from "vite";
import solidPlugin from "vite-plugin-solid";
import middleware from "#/dev/server/middleware.ts";
import middleware from "#/engine/dev/server/middleware.ts";
export const host = "localhost";
export const port = 3080;
export const root = fileURLToPath(new URL("./", import.meta.url));
function devTools(): Plugin {
return {
@@ -21,7 +22,7 @@ export default defineConfig({
plugins: [solidPlugin(), devTools()],
resolve: {
alias: {
"#/": fileURLToPath(new URL("./", import.meta.url)),
"#/": root,
},
},
});