The great move >.<

This commit is contained in:
kolaflash
2026-02-05 22:26:34 +01:00
parent 175ea1b726
commit 083cb70fbe
90 changed files with 85 additions and 137 deletions
+20
View File
@@ -0,0 +1,20 @@
import { createAnimation, playAnimation } from "#/engine/Animation.ts";
import { defineEntity } from "#/engine/Entity.ts";
import { fromSrc, type Sprite } from "#/engine/Sprite.ts";
import portal from "#/game/assets/portal.png";
const sprite: Sprite = await fromSrc(portal, 3, 1);
const { animate } = defineEntity("portal", {
animation: createAnimation(sprite, 400, 0),
});
animate((entity, ctx, delta) => {
playAnimation(
ctx,
entity.animation,
entity.position.x,
entity.position.y,
delta,
);
});