fun: hearts

This commit is contained in:
cha0s 2024-07-24 01:40:10 -05:00
parent c45d24b909
commit 3d7b0fc14e
4 changed files with 92 additions and 2 deletions

View File

@ -117,6 +117,7 @@ export default async function createHomestead(id) {
},
Controlled: {},
Direction: {direction: 2},
Emitter: {},
Forces: {},
Interactive: {
interacting: 1,

View File

@ -1,7 +1,7 @@
const {Collider, Controlled, Interacts, Inventory, Sound, Sprite} = wielder
const entities = Collider.closest(Interacts.aabb());
for (const entity of entities) {
const {Tags} = entity;
const {Emitter, Position, Tags} = entity;
if (Tags && Tags.has('kittan')) {
Controlled.locked = 1
const [, direction] = Sprite.animation.split(':')
@ -17,6 +17,94 @@ for (const entity of entities) {
source: '/assets/furball/furball.json',
});
Controlled.locked = 0;
const heartParticles = {
behaviors: [
{
type: 'moveAcceleration',
config: {
accel: {
x: 0,
y: -100,
},
minStart: 0,
maxStart: 0,
rotate: false,
}
},
{
type: 'moveSpeed',
config: {
speed: {
list: [
{
time: 0,
value: 30
},
{
time: 1,
value: 0
}
]
}
}
},
{
type: 'scale',
config: {
scale: {
list: [
{
value: 0.5,
time: 0,
},
{
value: 0.125,
time: 1,
},
]
}
}
},
{
type: 'textureSingle',
config: {
texture: '/assets/heart/heart.png',
}
},
],
lifetime: {
min: 0.5,
max: 0.5,
},
frequency: 0.1,
emitterLifetime: 0.25,
pos: {
x: 0,
y: 0
},
rotation: 180,
};
Emitter.emit({
...heartParticles,
behaviors: [
...heartParticles.behaviors,
{
type: 'spawnShape',
config: {
type: 'rect',
data: {
x: Position.x - 8,
y: Position.y,
w: 16,
h: 1,
}
}
}
]
})
break;
}
}

View File

@ -1,3 +1,4 @@
{
"icon": "/assets/furball/furball.png"
"icon": "/assets/furball/furball.png",
"label": "Fur Ball"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B