not sure its better or not
This commit is contained in:
@@ -4,7 +4,7 @@ import { fromSrc, type Sprite } from "#/lib/Sprite.ts";
|
||||
|
||||
const idle: Sprite = await fromSrc("/assets/hero/idle.png", 5, 4);
|
||||
|
||||
const { animate, process } = useEntity("barEntity", {
|
||||
const { animate, process } = useEntity(import.meta, {
|
||||
animation: createAnimation(0, 200),
|
||||
stuff: 1,
|
||||
});
|
||||
@@ -5,7 +5,7 @@ import { fromSrc, type Sprite } from "#/lib/Sprite.ts";
|
||||
|
||||
const idle: Sprite = await fromSrc(charIdle, 2, 4);
|
||||
|
||||
const { animate, process } = useEntity("fooEntity", {
|
||||
const { animate, process } = useEntity(import.meta, {
|
||||
animation: createAnimation(2, 500),
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ const { animate, process } = useEntity<{
|
||||
};
|
||||
currentAnimation: "idle" | "walk";
|
||||
stuff: number;
|
||||
}>("testEntity", {
|
||||
}>(import.meta, {
|
||||
animations: {
|
||||
idle: createAnimation(2, 500),
|
||||
walk: createAnimation(2, 250),
|
||||
Reference in New Issue
Block a user