fun: room peeps

This commit is contained in:
cha0s 2019-04-20 22:37:59 -05:00
parent 6f6c696d80
commit 8b6d713ab2

View File

@ -72,9 +72,15 @@ function fireJSON(position) {
function flowerBarrelJSON(position) {
return {
traits: {
alive: {
state: {
maxLife: 1000,
life: 1000,
},
},
collider: {},
emitter: {},
existent: {},
visible: {},
physical: {},
pictured: {
params: {
@ -102,6 +108,8 @@ function flowerBarrelJSON(position) {
},
},
},
visible: {},
vulnerable: {},
},
};
}
@ -147,7 +155,7 @@ function kittyJSON(position) {
params: {
animations: {
idle: {
offset: [0, -3],
offset: [0, -6],
uri: '/kitty.animation.json',
},
}
@ -266,7 +274,11 @@ function kittyJSON(position) {
},
emitter: {},
existent: {},
visible: {},
visible: {
state: {
visibleScale: [1.5, 1.5],
}
},
mobile: {
state: {
speed: 40,
@ -284,7 +296,7 @@ function kittyJSON(position) {
shape: {
type: 'rectangle',
position: [0, 0],
size: [8, 4],
size: [12, 6],
},
},
},
@ -331,17 +343,22 @@ const roomJSON = {
},
},
};
roomJSON.layers.everything.entities.push(fireJSON([200, 200]));
for (let i = 0; i < 4; ++i) {
for (let i = 0; i < 20; ++i) {
const x = Math.floor(Math.random() * 284) + 50;
const y = Math.floor(Math.random() * 284) + 50;
roomJSON.layers.everything.entities.push(flowerBarrelJSON([x * 4, y * 4]));
}
for (let i = 0; i < 40; ++i) {
for (let i = 0; i < 50; ++i) {
const x = Math.floor(Math.random() * 284) + 50;
const y = Math.floor(Math.random() * 284) + 50;
roomJSON.layers.everything.entities.push(kittyJSON([x * 4, y * 4]));
}
for (let i = 0; i < 15; ++i) {
const x = Math.floor(Math.random() * 284) + 50;
const y = Math.floor(Math.random() * 284) + 50;
roomJSON.layers.everything.entities.push(fireJSON([x * 4, y * 4]));
}
export function createRoom() {
const room = (new Room()).fromJSON(roomJSON);
room.world = new World();