Add start of ship rendering

This commit is contained in:
asraelite 2018-03-03 00:04:17 +00:00
parent 4a253b0184
commit 704c82838a
15 changed files with 199 additions and 13 deletions

12
js/graphics/ship.mjs Normal file
View file

@ -0,0 +1,12 @@
import {canvas, context} from './index.mjs';
import * as assets from '../assets.mjs';
import * as world from '../world/index.mjs';
export function render() {
world.ships.forEach(renderShip);
}
function renderShip(ship) {
context.fillStyle = 'red';
context.fillRect(ship.x, ship.y, 10, 10);
}