Add particles
This commit is contained in:
parent
dda4a44386
commit
9435e887a4
11 changed files with 1684 additions and 4826 deletions
|
@ -16,7 +16,7 @@ export function render() {
|
|||
|
||||
renderLayer(patterns.back, 0.3, 1);
|
||||
renderLayer(patterns.middle, 0.5, 0.3);
|
||||
renderLayer(patterns.front, 0.7, 0.3);
|
||||
//renderLayer(patterns.front, 0.7, 0.3);
|
||||
}
|
||||
|
||||
function renderLayer(pattern, speed = 1, scale = 1) {
|
||||
|
|
|
@ -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