This commit is contained in:
asraelite 2018-03-03 00:39:25 +00:00
parent 704c82838a
commit 6a67a73c59
5 changed files with 324 additions and 2 deletions

View file

@ -2,6 +2,17 @@ export const images = {
title: {
logo: 'logo.png',
logoSvg: 'logo2.svg'
},
modules: {
capsule: {
small: 'modules/small_capsule.svg'
},
fuel: {
small: 'modules/small_fuel_tank.svg'
},
thruster: {
light: 'modules/light_thruster.svg'
}
}
};

View file

@ -1,5 +1,5 @@
import {canvas, context} from './index.mjs';
import * as assets from '../assets.mjs';
import {images as assets} from '../assets.mjs';
import * as world from '../world/index.mjs';
export function render() {
@ -8,5 +8,12 @@ export function render() {
function renderShip(ship) {
context.fillStyle = 'red';
context.fillRect(ship.x, ship.y, 10, 10);
//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);
}