Compare commits

..

2 Commits

Author SHA1 Message Date
f048f79198 feat: final generated assets 2026-07-27 13:27:42 -04:00
ff6a418e16 feat: more assets 2026-07-27 11:03:23 -04:00
11 changed files with 24 additions and 7 deletions

BIN
assets/actor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
assets/chicken.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

BIN
assets/pot.gen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

BIN
assets/pot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
assets/rock.gen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

BIN
assets/shard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -17,7 +17,7 @@ export function addChicken(k, world, tile) {
const chicken = k.add([
...visual(k, "chicken"),
k.pos(p),
k.area({ collisionIgnore: ["player", "link", "chicken"] }),
k.area({ collisionIgnore: ["player", "link", "chicken"], scale: 0.7 }),
k.body(),
k.state("idle", ["idle", "chase"]),
"chicken",
@ -49,8 +49,10 @@ export function addChicken(k, world, tile) {
}
if (chicken.wanderTarget) {
const d = world.tc(chicken.wanderTarget).sub(chicken.pos);
if (d.len() > 2) chicken.move(d.unit().scale(CHICKEN_SPEED * 0.4));
else chicken.wanderTarget = null;
if (d.len() > 2) {
if (Math.abs(d.x) > 1) chicken.flipX = d.x < 0;
chicken.move(d.unit().scale(CHICKEN_SPEED * 0.4));
} else chicken.wanderTarget = null;
}
});
@ -64,7 +66,10 @@ export function addChicken(k, world, tile) {
return;
}
const d = tgt.pos.sub(chicken.pos);
if (d.len() > 2) chicken.move(d.unit().scale(CHICKEN_SPEED));
if (d.len() > 2) {
if (Math.abs(d.x) > 1) chicken.flipX = d.x < 0;
chicken.move(d.unit().scale(CHICKEN_SPEED));
}
});
chicken.onUpdate(() => {

View File

@ -8,7 +8,7 @@ export function addPlayer(k, world) {
const player = k.add([
...visual(k, "player"),
k.pos(p),
k.area({ collisionIgnore: ["link", "chicken"] }),
k.area({ collisionIgnore: ["link", "chicken"], scale: 0.4 }),
k.body(), // dynamic body: pushed out of static obstacles/walls
"player",
]);

View File

@ -17,6 +17,12 @@ k.setGravity(0);
// Actor sprites.
k.loadSprite("link", "assets/link.png");
k.loadSprite("grass", "assets/grasss.png");
k.loadSprite("player", "assets/actor.png");
k.loadSprite("shard", "assets/shard.png");
k.loadSprite("chicken", "assets/chicken.png");
k.loadSprite("pot", "assets/pot.gen.png");
k.loadSprite("obstacle", "assets/rock.gen.png");
// Background music. Browsers block autoplay until the user interacts, so start
// looping on the first key/click and keep the handle across scene changes.

View File

@ -112,9 +112,9 @@ function spawnShard(k, world, tile) {
const s = k.add([
...visual(k, "shard"),
k.pos(p.x + jx, p.y + jy),
k.area(),
k.area({ scale: 0.55 }),
k.z(p.y),
k.rotate(k.rand() * 360),
k.rotate((k.rand() - 0.5) * 24), // slight tilt; keep debris upright-ish
"shard",
]);
return s;

View File

@ -17,6 +17,12 @@ const SPEC = {
// fall back to the placeholder shapes in SPEC.
const SPRITES = {
link: { name: "link", scale: 0.44 },
grass: { name: "grass", scale: 1.6 }, // 16px tile -> ~26px clump
player: { name: "player", scale: 0.13 }, // 428px art -> ~52px tall
shard: { name: "shard", scale: 0.085 }, // 500px debris -> ~26px clump
chicken: { name: "chicken", scale: 1.1 },
pot: { name: "pot", scale: 0.6 }, // 48px art -> ~29px
obstacle: { name: "obstacle", scale: 0.78 }, // 48px art -> ~37px
};
export function visual(k, kind) {