Add particles

This commit is contained in:
asraelite 2018-03-04 01:21:34 +00:00
parent dda4a44386
commit 9435e887a4
11 changed files with 1684 additions and 4826 deletions

View file

@ -3,11 +3,14 @@ import {images as assets} from '../assets.mjs';
import * as world from '../world/index.mjs';
export function render() {
world.particles.forEach(renderParticle);
world.celestials.forEach(renderCelestial);
world.ships.forEach(renderShip);
if (typeof window.q !== 'undefined') {
context.fillStyle = 'red';
}
}
function renderParticle(particle) {
context.fillStyle = particle.color;
context.fillRect(...particle.com, particle.size, particle.size);
}
function renderShip(ship) {