The great move >.<
@@ -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=="],
|
"@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=="],
|
"@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/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=="],
|
"@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=="],
|
"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=="],
|
"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=="],
|
"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=="],
|
"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,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>();
|
export const spriteMap = new Map<string, Sprite>();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { Animation } from "#/engine/Animation.ts";
|
import type { Animation } from "./Animation.ts";
|
||||||
import { createVector, type Vector } from "#/lib/Vector.ts";
|
import { createVector, type Vector } from "./Vector.ts";
|
||||||
|
|
||||||
export type Indirect = never;
|
export type Indirect = never;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Vector } from "#/lib/Vector.ts";
|
import type { Vector } from "./Vector.ts";
|
||||||
import { viewport } from "./Viewport.ts";
|
import { viewport } from "./Viewport.ts";
|
||||||
|
|
||||||
export type Pointer = {
|
export type Pointer = {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
entityProcessMap,
|
entityProcessMap,
|
||||||
type Indirect,
|
type Indirect,
|
||||||
type Process as ProcessEntity,
|
type Process as ProcessEntity,
|
||||||
} from "#/engine/Entity.ts";
|
} from "./Entity.ts";
|
||||||
import { useWithAsyncCache } from "#/lib/cache.ts";
|
import { type Graph, getNeighbours } from "./Graph.ts";
|
||||||
import { type Graph, getNeighbours } from "#/lib/Graph.ts";
|
import { useWithAsyncCache } from "./lib/cache.ts";
|
||||||
|
|
||||||
export type SceneData = {
|
export type SceneData = {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -50,7 +50,7 @@ const sceneInstancesMap = new Map<string, Array<Entity<unknown>>>();
|
|||||||
|
|
||||||
export const [loadScene, sceneCache] = useWithAsyncCache(
|
export const [loadScene, sceneCache] = useWithAsyncCache(
|
||||||
async (name: string) => {
|
async (name: string) => {
|
||||||
await import(`#/scenes/${name}/scene.ts`);
|
await import(`#/game/scenes/${name}/scene.ts`);
|
||||||
|
|
||||||
const data = sceneDataMap.get(name)!;
|
const data = sceneDataMap.get(name)!;
|
||||||
const entityInstanceMap = sceneEntiyMap.get(name)!;
|
const entityInstanceMap = sceneEntiyMap.get(name)!;
|
||||||
@@ -58,7 +58,7 @@ export const [loadScene, sceneCache] = useWithAsyncCache(
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
data.entities.map(async (entity: Entity<unknown>) => {
|
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)) {
|
if (!entityInstanceMap.has(entity.name)) {
|
||||||
entityInstanceMap.set(entity.name, {
|
entityInstanceMap.set(entity.name, {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { lerp } from "./lerp.ts";
|
import { lerp } from "./lib/lerp.ts";
|
||||||
import type { Vector } from "./Vector.ts";
|
import type { Vector } from "./Vector.ts";
|
||||||
|
|
||||||
export type Segment = [Vector, Vector];
|
export type Segment = [Vector, Vector];
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loadImage } from "./loadImage.ts";
|
import { loadImage } from "./lib/loadImage.ts";
|
||||||
|
|
||||||
export type Sprite = {
|
export type Sprite = {
|
||||||
image: HTMLImageElement;
|
image: HTMLImageElement;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { createVector, type Vector } from "#/lib/Vector.ts";
|
import { createVector, type Vector } from "./Vector.ts";
|
||||||
|
|
||||||
export type Viewport = {
|
export type Viewport = {
|
||||||
scale: number;
|
scale: number;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
For,
|
For,
|
||||||
Show,
|
Show,
|
||||||
} from "solid-js";
|
} from "solid-js";
|
||||||
import { FileIcon } from "#/dev/icons/File.tsx";
|
import { FileIcon } from "./icons/File.tsx";
|
||||||
import { FolderIcon } from "#/dev/icons/Folder.tsx";
|
import { FolderIcon } from "./icons/Folder.tsx";
|
||||||
import { FolderOpenIcon } from "#/dev/icons/FolderOpen.tsx";
|
import { FolderOpenIcon } from "./icons/FolderOpen.tsx";
|
||||||
|
|
||||||
export type BrowserFile = {
|
export type BrowserFile = {
|
||||||
path: string;
|
path: string;
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
import "./GraphBrowser.css";
|
import "./GraphBrowser.css";
|
||||||
import { type Component, createSignal, onMount } from "solid-js";
|
import { type Component, createSignal, onMount } from "solid-js";
|
||||||
import { currentScene } from "#/engine/Scene.ts";
|
|
||||||
import {
|
import {
|
||||||
type Edge,
|
type Edge,
|
||||||
type Graph,
|
type Graph,
|
||||||
getNeighbours,
|
getNeighbours,
|
||||||
type Node,
|
type Node,
|
||||||
} from "#/lib/Graph.ts";
|
} from "#/engine/Graph.ts";
|
||||||
import { mulberry32 } from "#/lib/mulberry32.ts";
|
import { mulberry32 } from "#/engine/lib/mulberry32.ts";
|
||||||
|
import { currentScene } from "#/engine/Scene.ts";
|
||||||
import {
|
import {
|
||||||
createVector,
|
createVector,
|
||||||
getDistance,
|
getDistance,
|
||||||
scale,
|
scale,
|
||||||
setDistanceNormal,
|
setDistanceNormal,
|
||||||
type Vector,
|
type Vector,
|
||||||
} from "#/lib/Vector.ts";
|
} from "#/engine/Vector.ts";
|
||||||
|
|
||||||
type PhysicsPartial = {
|
type PhysicsPartial = {
|
||||||
position: Vector;
|
position: Vector;
|
||||||
@@ -10,10 +10,10 @@ import {
|
|||||||
type Signal,
|
type Signal,
|
||||||
Switch,
|
Switch,
|
||||||
} from "solid-js";
|
} from "solid-js";
|
||||||
import { ArrowNarrowDownIcon } from "#/dev/icons/ArrowNarrowDown.tsx";
|
import { ArrowNarrowDownIcon } from "./icons/ArrowNarrowDown.tsx";
|
||||||
import { ArrowNarrowUpIcon } from "#/dev/icons/ArrowNarrowUp.tsx";
|
import { ArrowNarrowUpIcon } from "./icons/ArrowNarrowUp.tsx";
|
||||||
import { ArrowsSortIcon } from "#/dev/icons/ArrowsSort.tsx";
|
import { ArrowsSortIcon } from "./icons/ArrowsSort.tsx";
|
||||||
import { ChevronDownIcon } from "#/dev/icons/ChevronDown.tsx";
|
import { ChevronDownIcon } from "./icons/ChevronDown.tsx";
|
||||||
|
|
||||||
export type ListItem = { label: string; isActive: boolean };
|
export type ListItem = { label: string; isActive: boolean };
|
||||||
|
|
||||||
@@ -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> {
|
export async function fetchBrowserData(dir: string): Promise<BrowserFolder> {
|
||||||
const indexRef: string[] = await (await fetch(`/api/${dir}`)).json();
|
const indexRef: string[] = await (await fetch(`/api/${dir}`)).json();
|
||||||
@@ -7,16 +7,7 @@ import {
|
|||||||
Show,
|
Show,
|
||||||
} from "solid-js";
|
} from "solid-js";
|
||||||
import { render } from "solid-js/web";
|
import { render } from "solid-js/web";
|
||||||
import { InputField } from "#/dev/controls/InputField.tsx";
|
import { spriteMap } from "#/engine/Animation.ts";
|
||||||
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 type { Entity } from "#/engine/Entity.ts";
|
import type { Entity } from "#/engine/Entity.ts";
|
||||||
import {
|
import {
|
||||||
currentScene,
|
currentScene,
|
||||||
@@ -27,7 +18,16 @@ import {
|
|||||||
setScene,
|
setScene,
|
||||||
} from "#/engine/Scene.ts";
|
} from "#/engine/Scene.ts";
|
||||||
import { setScale, viewport } from "#/engine/Viewport.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 { 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[]> {
|
async function fetchScenes(): Promise<string[]> {
|
||||||
const indexRef: string[] = await (await fetch(`/api/scenes`)).json();
|
const indexRef: string[] = await (await fetch(`/api/scenes`)).json();
|
||||||
@@ -192,7 +192,7 @@ const DevTools: Component<{ gameContainer: HTMLElement }> = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ItemList name="Scenes" handler={setCurrentScene} items={scenes} />
|
<ItemList name="Scenes" handler={setCurrentScene} items={scenes} />
|
||||||
<GraphBrowser graph={sceneGraph} seed={1300346452} />
|
<GraphBrowser graph={sceneGraph} seed={2802446152} />
|
||||||
|
|
||||||
<ItemList name="Entities" handler={selectEntity} items={entities} />
|
<ItemList name="Entities" handler={selectEntity} items={entities} />
|
||||||
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { readdirSync, writeFileSync } from "node:fs";
|
import { readdirSync, writeFileSync } from "node:fs";
|
||||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||||
|
import { root } from "../../../vite.config.ts";
|
||||||
|
|
||||||
function buildBrowserIndex(dir: string): string[] {
|
function buildBrowserIndex(dir: string): string[] {
|
||||||
const dirents = readdirSync(dir, {
|
const dirents = readdirSync(dir, {
|
||||||
@@ -10,11 +11,19 @@ function buildBrowserIndex(dir: string): string[] {
|
|||||||
return dirents
|
return dirents
|
||||||
.filter((dirent) => dirent.isFile())
|
.filter((dirent) => dirent.isFile())
|
||||||
.map((dirent) => {
|
.map((dirent) => {
|
||||||
const path = dirent.parentPath.substring(dir.length);
|
const path = dirent.parentPath.substring(dir.length - 1);
|
||||||
|
|
||||||
return `${path}/${dirent.name}`;
|
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 {
|
function get(req: IncomingMessage, res: ServerResponse): void {
|
||||||
const match = req.url?.match(/^\/(\w+)$/);
|
const match = req.url?.match(/^\/(\w+)$/);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
@@ -24,10 +33,12 @@ function get(req: IncomingMessage, res: ServerResponse): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sceneData = buildBrowserIndex(match[1]);
|
switch (req.url) {
|
||||||
|
case "/scenes": {
|
||||||
res.writeHead(200, { "Content-Type": "application/json" });
|
getScenes(req, res);
|
||||||
res.end(JSON.stringify(sceneData));
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function post(req: IncomingMessage, res: ServerResponse): void {
|
function post(req: IncomingMessage, res: ServerResponse): void {
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 551 B |
|
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 700 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 815 B |
|
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 { createAnimation, playAnimation } from "#/engine/Animation.ts";
|
||||||
import { defineEntity } from "#/engine/Entity.ts";
|
import { defineEntity } from "#/engine/Entity.ts";
|
||||||
import { keyboardInput } from "#/engine/Keyboard.ts";
|
import { keyboardInput } from "#/engine/Keyboard.ts";
|
||||||
import { pointer } from "#/engine/Pointer.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);
|
const idle: Sprite = await fromSrc(charIdle, 2, 4);
|
||||||
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import { createAnimation, playAnimation } from "#/engine/Animation.ts";
|
import { createAnimation, playAnimation } from "#/engine/Animation.ts";
|
||||||
import { defineEntity } from "#/engine/Entity.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", {
|
const { animate } = defineEntity("portal", {
|
||||||
animation: createAnimation(sprite, 400, 0),
|
animation: createAnimation(sprite, 400, 0),
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
import charIdle from "#/assets/char-idle.png";
|
|
||||||
import charWalk from "#/assets/char-walk.png";
|
|
||||||
import {
|
import {
|
||||||
type Animation,
|
type Animation,
|
||||||
createAnimation,
|
createAnimation,
|
||||||
playAnimation,
|
playAnimation,
|
||||||
} from "#/engine/Animation.ts";
|
} from "#/engine/Animation.ts";
|
||||||
import { defineEntity } from "#/engine/Entity.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 { viewport } from "#/engine/Viewport.ts";
|
||||||
import { loadImage } from "#/lib/loadImage.ts";
|
import charIdle from "#/game/assets/char-idle.png";
|
||||||
import { createSprite } from "#/lib/Sprite.ts";
|
import charWalk from "#/game/assets/char-walk.png";
|
||||||
|
|
||||||
const sprites = {
|
const sprites = {
|
||||||
idle: createSprite(await loadImage(charIdle), 2, 4),
|
idle: createSprite(await loadImage(charIdle), 2, 4),
|
||||||
@@ -9,13 +9,6 @@
|
|||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0
|
"y": 0
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "barEntity",
|
|
||||||
"position": {
|
|
||||||
"x": 24,
|
|
||||||
"y": 16
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hero",
|
"name": "testEntity",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 24,
|
"x": 24,
|
||||||
"y": 16
|
"y": 16
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { pointer } from "#/engine/Pointer.ts";
|
import { pointer } from "#/engine/Pointer.ts";
|
||||||
import { defineScene } from "#/engine/Scene.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";
|
import data from "./data.json";
|
||||||
|
|
||||||
const { process, preProcess, linkScenes } = defineScene(data);
|
const { process, preProcess, linkScenes } = defineScene(data);
|
||||||
|
|
||||||
linkScenes(["fooScene", "fuzzScene"] as const);
|
linkScenes(["fooScene"] as const);
|
||||||
|
|
||||||
preProcess((entityInstanceMap) => {
|
preProcess((entityInstanceMap) => {
|
||||||
const entity = entityInstanceMap.get(data.entities[0].name);
|
const entity = entityInstanceMap.get(data.entities[0].name);
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { listenKeyboard } from "#/engine/Keyboard.ts";
|
||||||
import { listenPointer } from "#/engine/Pointer.ts";
|
import { listenPointer } from "#/engine/Pointer.ts";
|
||||||
import { currentScene, setScene } from "#/engine/Scene.ts";
|
import { currentScene, setScene } from "#/engine/Scene.ts";
|
||||||
import {
|
import {
|
||||||
@@ -6,7 +7,6 @@ import {
|
|||||||
resizeCanvas,
|
resizeCanvas,
|
||||||
viewport,
|
viewport,
|
||||||
} from "#/engine/Viewport.ts";
|
} from "#/engine/Viewport.ts";
|
||||||
import { listenKeyboard } from "./engine/Keyboard.ts";
|
|
||||||
|
|
||||||
let then = self.performance.now();
|
let then = self.performance.now();
|
||||||
let delta = 0;
|
let delta = 0;
|
||||||
@@ -21,7 +21,7 @@ function animate(timestamp: number): void {
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
if (import.meta.env.DEV) {
|
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();
|
initViewport();
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
"check": "biome check --write"
|
"check": "biome check --write"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.3.11",
|
"@biomejs/biome": "2.3.14",
|
||||||
"@types/bun": "1.3.6",
|
"@types/bun": "1.3.8",
|
||||||
"lz-string": "1.5.0",
|
"lz-string": "1.5.0",
|
||||||
"solid-js": "1.9.10",
|
"solid-js": "1.9.11",
|
||||||
"vite": "7.3.1",
|
"vite": "7.3.1",
|
||||||
"vite-plugin-solid": "2.11.10"
|
"vite-plugin-solid": "2.11.10"
|
||||||
},
|
},
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 551 B |
|
Before Width: | Height: | Size: 700 B |
|
Before Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 815 B |
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -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) => {});
|
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
import { fileURLToPath, URL } from "node:url";
|
import { fileURLToPath, URL } from "node:url";
|
||||||
import { defineConfig, type Plugin } from "vite";
|
import { defineConfig, type Plugin } from "vite";
|
||||||
import solidPlugin from "vite-plugin-solid";
|
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 host = "localhost";
|
||||||
export const port = 3080;
|
export const port = 3080;
|
||||||
|
export const root = fileURLToPath(new URL("./", import.meta.url));
|
||||||
|
|
||||||
function devTools(): Plugin {
|
function devTools(): Plugin {
|
||||||
return {
|
return {
|
||||||
@@ -21,7 +22,7 @@ export default defineConfig({
|
|||||||
plugins: [solidPlugin(), devTools()],
|
plugins: [solidPlugin(), devTools()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"#/": fileURLToPath(new URL("./", import.meta.url)),
|
"#/": root,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||