Meh
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import charIdle from "#/assets/char-idle.png";
|
||||
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(charIdle, 2, 4);
|
||||
|
||||
const { animate, process } = useEntity("fooEntity", {
|
||||
animation: createAnimation(2, 500),
|
||||
});
|
||||
|
||||
animate((entity, ctx, delta) => {
|
||||
animateSprite(
|
||||
ctx,
|
||||
idle,
|
||||
entity.animation,
|
||||
entity.position.x,
|
||||
entity.position.y,
|
||||
delta,
|
||||
);
|
||||
});
|
||||
|
||||
process((entity, delta) => {});
|
||||
Reference in New Issue
Block a user