fun: animules

This commit is contained in:
cha0s 2024-08-05 22:56:59 -05:00
parent b3f162b323
commit 8e4bfaf6b7
12 changed files with 560 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,263 @@
{
"animations": {
"idle:up": [
"farm/animals/cow-adult/cow-adult/10"
],
"idle:right": [
"farm/animals/cow-adult/cow-adult/7"
],
"idle:down": [
"farm/animals/cow-adult/cow-adult/1"
],
"idle:left": [
"farm/animals/cow-adult/cow-adult/4"
],
"moving:down": [
"farm/animals/cow-adult/cow-adult/0",
"farm/animals/cow-adult/cow-adult/1",
"farm/animals/cow-adult/cow-adult/2"
],
"moving:left": [
"farm/animals/cow-adult/cow-adult/3",
"farm/animals/cow-adult/cow-adult/4",
"farm/animals/cow-adult/cow-adult/5"
],
"moving:right": [
"farm/animals/cow-adult/cow-adult/6",
"farm/animals/cow-adult/cow-adult/7",
"farm/animals/cow-adult/cow-adult/8"
],
"moving:up": [
"farm/animals/cow-adult/cow-adult/9",
"farm/animals/cow-adult/cow-adult/10",
"farm/animals/cow-adult/cow-adult/11"
]
},
"frames": {
"farm/animals/cow-adult/cow-adult/0": {
"frame": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/1": {
"frame": {
"x": 42,
"y": 0,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/2": {
"frame": {
"x": 84,
"y": 0,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/3": {
"frame": {
"x": 0,
"y": 36,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/4": {
"frame": {
"x": 42,
"y": 36,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/5": {
"frame": {
"x": 84,
"y": 36,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/6": {
"frame": {
"x": 0,
"y": 72,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/7": {
"frame": {
"x": 42,
"y": 72,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/8": {
"frame": {
"x": 84,
"y": 72,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/9": {
"frame": {
"x": 0,
"y": 108,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/10": {
"frame": {
"x": 42,
"y": 108,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/cow-adult/cow-adult/11": {
"frame": {
"x": 84,
"y": 108,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
}
},
"meta": {
"format": "RGBA8888",
"image": "./cow-adult.png",
"scale": 1,
"size": {
"w": 126,
"h": 144
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,17 @@
entity.Direction.direction = Math.random() * Math.TAU;
entity.Controlled.directionMove(entity.Direction.direction);
await wait(0.25 + Math.random() * 2.25);
entity.Controlled.stop();
entity.Sprite.isAnimating = 0;
await wait(1 + Math.random() * 3);
entity.Direction.direction = Math.random() * Math.TAU;
await wait(0.5 + Math.random() * 2.5);
entity.Sprite.isAnimating = 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,263 @@
{
"animations": {
"idle:up": [
"farm/animals/goat-white/goat-white/10"
],
"idle:right": [
"farm/animals/goat-white/goat-white/7"
],
"idle:down": [
"farm/animals/goat-white/goat-white/1"
],
"idle:left": [
"farm/animals/goat-white/goat-white/4"
],
"moving:down": [
"farm/animals/goat-white/goat-white/0",
"farm/animals/goat-white/goat-white/1",
"farm/animals/goat-white/goat-white/2"
],
"moving:left": [
"farm/animals/goat-white/goat-white/3",
"farm/animals/goat-white/goat-white/4",
"farm/animals/goat-white/goat-white/5"
],
"moving:right": [
"farm/animals/goat-white/goat-white/6",
"farm/animals/goat-white/goat-white/7",
"farm/animals/goat-white/goat-white/8"
],
"moving:up": [
"farm/animals/goat-white/goat-white/9",
"farm/animals/goat-white/goat-white/10",
"farm/animals/goat-white/goat-white/11"
]
},
"frames": {
"farm/animals/goat-white/goat-white/0": {
"frame": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/1": {
"frame": {
"x": 42,
"y": 0,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/2": {
"frame": {
"x": 84,
"y": 0,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/3": {
"frame": {
"x": 0,
"y": 36,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/4": {
"frame": {
"x": 42,
"y": 36,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/5": {
"frame": {
"x": 84,
"y": 36,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/6": {
"frame": {
"x": 0,
"y": 72,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/7": {
"frame": {
"x": 42,
"y": 72,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/8": {
"frame": {
"x": 84,
"y": 72,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/9": {
"frame": {
"x": 0,
"y": 108,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/10": {
"frame": {
"x": 42,
"y": 108,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
},
"farm/animals/goat-white/goat-white/11": {
"frame": {
"x": 84,
"y": 108,
"w": 42,
"h": 36
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 42,
"h": 36
},
"sourceSize": {
"w": 42,
"h": 36
}
}
},
"meta": {
"format": "RGBA8888",
"image": "./goat-white.png",
"scale": 1,
"size": {
"w": 126,
"h": 144
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,17 @@
entity.Direction.direction = Math.random() * Math.TAU;
entity.Controlled.directionMove(entity.Direction.direction);
await wait(0.25 + Math.random() * 2.25);
entity.Controlled.stop();
entity.Sprite.isAnimating = 0;
await wait(1 + Math.random() * 3);
entity.Direction.direction = Math.random() * Math.TAU;
await wait(0.5 + Math.random() * 2.5);
entity.Sprite.isAnimating = 1;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB