fun: blue fire

This commit is contained in:
cha0s 2019-04-22 21:03:39 -05:00
parent b934365ce7
commit 227e861e09
5 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,7 @@
{
"frameRate": 0.2,
"frameCount": 4,
"frameSize": [32, 32],
"directionCount": 1,
"imageUri": "/blue-fire.png"
}

BIN
resource/blue-fire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

View File

@ -0,0 +1,7 @@
{
"interval": 0.025,
"src": [
"/heal.wav"
],
"volume": 0.03
}

BIN
resource/heal.wav Executable file

Binary file not shown.

View File

@ -102,6 +102,15 @@ function fireJSON(position) {
},
};
}
// Healing fire!
function blueFireJSON(position) {
const json = fireJSON(position);
json.traits.animated.params.animations.idle.uri = '/blue-fire.animation.json';
json.traits.damaging.params.damageSpecs[0].power = -5;
json.traits.damaging.params.damageSpecs[0].lock = 0.02;
json.traits.audible.params.sounds.fire.uri = '/blue-fire.sound.json';
return json;
}
// A flower barrel.
function flowerBarrelJSON(position) {
return {
@ -446,6 +455,11 @@ for (let i = 0; i < 30; ++i) {
const y = Math.floor(Math.random() * 284) + 50;
roomJSON.layers.everything.entities.push(fireJSON([x * 4, y * 4]));
}
for (let i = 0; i < 1; ++i) {
const x = Math.floor(Math.random() * 284) + 50;
const y = Math.floor(Math.random() * 284) + 50;
roomJSON.layers.everything.entities.push(blueFireJSON([x * 4, y * 4]));
}
export function createRoom() {
const room = (new Room()).fromJSON(roomJSON);
room.world = new World();