WIP
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { useEntity } from "#/engine/Entity.ts";
|
import { useEntity } from "#/engine/Entity.ts";
|
||||||
|
import { viewport } from "#/engine/Viewport.ts";
|
||||||
import { loadImage } from "#/lib/loadImage.ts";
|
import { loadImage } from "#/lib/loadImage.ts";
|
||||||
import { createSprite, drawSprite } from "#/lib/Sprite.ts";
|
import { createSprite, drawSprite } from "#/lib/Sprite.ts";
|
||||||
|
|
||||||
@@ -17,10 +18,10 @@ animate((entity, ctx, _delta) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
process((entity, _delta) => {
|
process((entity, _delta) => {
|
||||||
if (entity.state.stuff === 1) {
|
entity.position.x += entity.state.stuff;
|
||||||
entity.position.x += 1;
|
if (entity.position.x > viewport.canvas.width - 16) {
|
||||||
if (entity.position.x > 164) {
|
entity.state.stuff = -1;
|
||||||
entity.state.stuff = 0;
|
} else if (entity.position.x < 0) {
|
||||||
}
|
entity.state.stuff = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"id": "testScene",
|
"id": "testScene",
|
||||||
"width": 180,
|
"width": 80,
|
||||||
"height": 48,
|
"height": 48,
|
||||||
"entities": [
|
"entities": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user