feat: real physics and more barrels

This commit is contained in:
cha0s 2019-03-24 04:05:27 -05:00
parent 408e91b453
commit 95e65040bf

View File

@ -8,7 +8,7 @@ import {
EntityList, EntityList,
registerTrait, registerTrait,
} from '@avocado/entity'; } from '@avocado/entity';
import {World} from '@avocado/physics/dummy/world'; import {World} from '@avocado/physics/matter/world';
import {StateSynchronizer} from '@avocado/state'; import {StateSynchronizer} from '@avocado/state';
// Create game. // Create game.
export default function(avocadoServer) { export default function(avocadoServer) {
@ -22,9 +22,9 @@ const informables = [];
const stateSynchronizer = new StateSynchronizer({ const stateSynchronizer = new StateSynchronizer({
entityList, entityList,
}); });
for (let i = 0; i < 20; ++i) { for (let i = 0; i < 40; ++i) {
const x = Math.floor(Math.random() * 1000) + 100; const x = Math.floor(Math.random() * 800) + 200;
const y = Math.floor(Math.random() * 500) + 100; const y = Math.floor(Math.random() * 300) + 200;
const flowerBarrel = createFlowerBarrelEntity([x, y]); const flowerBarrel = createFlowerBarrelEntity([x, y]);
entityList.addEntity(flowerBarrel); entityList.addEntity(flowerBarrel);
} }