Add particles
This commit is contained in:
parent
dda4a44386
commit
9435e887a4
11 changed files with 1684 additions and 4826 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue