Add start of ship editing grid

This commit is contained in:
asraelite 2018-03-05 00:57:33 +00:00
parent b88c0eb358
commit 2fbabc785e
16 changed files with 249 additions and 18 deletions

View file

@ -1,6 +1,8 @@
import {canvas, context} from './index.mjs';
import {images as assets} from '../assets.mjs';
import * as world from '../world/index.mjs';
import * as edit from './edit.mjs';
import {state} from '../game/index.mjs';
export function render() {
world.particles.forEach(renderParticle);
@ -20,6 +22,10 @@ function renderShip(ship) {
let [cx, cy] = ship.localCom;
context.translate(-cx, -cy);
ship.modules.forEach(m => {
let [mx, my] = [m.x, m.y];
if (state.editing) {
}
context.drawImage(m.currentImage, m.x, m.y, 1, 1);
});
context.restore();