This commit is contained in:
kolaflash
2025-12-25 20:01:32 +01:00
parent e5bc240056
commit c6b1755d32
15 changed files with 140 additions and 70 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
import charIdle from "#/assets/char-idle.png";
import charWalk from "#/assets/char-walk.png";
import { useEntity } from "#/engine/Entity.ts";
import { viewport } from "#/engine/Viewport.ts";
import {
@@ -9,8 +11,8 @@ import { loadImage } from "#/lib/loadImage.ts";
import { createSprite } from "#/lib/Sprite.ts";
const sprites = {
idle: createSprite(await loadImage("/assets/char-idle.png"), 2, 4),
walk: createSprite(await loadImage("/assets/char-walk.png"), 4, 4),
idle: createSprite(await loadImage(charIdle), 2, 4),
walk: createSprite(await loadImage(charWalk), 4, 4),
};
const { animate, process } = useEntity<{