Add zooming

This commit is contained in:
asraelite 2018-03-03 13:29:14 +00:00
parent 56a09f98c5
commit b02675f4fb
12 changed files with 156 additions and 29 deletions

View file

@ -1,19 +0,0 @@
import {canvas, context} from './index.mjs';
import {images 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);
let size = 100;
context.drawImage(assets.modules.capsule.small, ship.x, ship.y,
size, size);
context.drawImage(assets.modules.fuel.small, ship.x, ship.y + size,
size, size);
context.drawImage(assets.modules.thruster.light, ship.x,
ship.y + size * 2, size, size);
}