This commit is contained in:
kolaflash
2026-01-04 19:34:15 +01:00
parent 415a0c6b6f
commit ead8f3ce5a
21 changed files with 244 additions and 46 deletions
+22
View File
@@ -0,0 +1,22 @@
import { useEntity } from "#/engine/Entity.ts";
import { animateSprite, createAnimation } from "#/lib/Animation.ts";
import { fromSrc, type Sprite } from "#/lib/Sprite.ts";
const idle: Sprite = await fromSrc("/assets/hero/idle.png", 5, 4);
const { animate, process } = useEntity("barEntity", {
animation: createAnimation(0, 200),
});
animate((entity, ctx, delta) => {
animateSprite(
ctx,
idle,
entity.animation,
entity.position.x,
entity.position.y,
delta,
);
});
process((entity, delta) => {});