WIP
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import charIdle from "#/assets/char-idle.png";
|
||||
import { createAnimation, playAnimation } from "#/engine/Animation.ts";
|
||||
import { defineEntity } from "#/engine/Entity.ts";
|
||||
import { keyboardInput } from "#/engine/Keyboard.ts";
|
||||
import { pointer } from "#/engine/Pointer.ts";
|
||||
import { fromSrc, type Sprite } from "#/lib/Sprite.ts";
|
||||
|
||||
@@ -25,4 +26,9 @@ process((entity, delta) => {
|
||||
entity.position.x = pointer.position.x;
|
||||
entity.position.y = pointer.position.y;
|
||||
}
|
||||
|
||||
entity.position.x -= keyboardInput.arrowLeft ? 1 : 0;
|
||||
entity.position.x += keyboardInput.arrowRight ? 1 : 0;
|
||||
entity.position.y -= keyboardInput.arrowUp ? 1 : 0;
|
||||
entity.position.y += keyboardInput.arrowDown ? 1 : 0;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user