Add basic controls

This commit is contained in:
kolaflash
2026-01-23 14:21:21 +01:00
parent 589af23e8c
commit f9a2409dad
19 changed files with 225 additions and 47 deletions
+2 -3
View File
@@ -21,14 +21,13 @@ export const entityMap = new Map<string, Entity<unknown>>();
export const entityAnimateMap = new Map<string, Animate<Indirect>>();
export const entityProcessMap = new Map<string, Process<Indirect>>();
export function useEntity<T extends { animation: Animation }>(
meta: { url: string },
export function defineEntity<T extends { animation: Animation }>(
name: string,
state: T,
): {
animate: (fn: Animate<T>) => void;
process: (fn: Process<T>) => void;
} {
const name = meta.url.match(/entities\/(.+)\/entity\.ts$/)![1];
entityMap.set(name, {
name,
position: createVector(),