Add start of ship editing

This commit is contained in:
asraelite 2018-03-04 16:49:42 +00:00
parent d85338d9f2
commit b88c0eb358
18 changed files with 288 additions and 100 deletions

View file

@ -5,6 +5,7 @@ import GuiFrame from './frame.mjs';
import GuiImage from './image.mjs';
import GuiButton from './button.mjs';
import * as events from '../game/events.mjs';
import {state} from '../game/index.mjs';
export function root() {
return new GuiFrame(0, 0, canvas.width, canvas.height, {
@ -36,6 +37,14 @@ export function title() {
export function game() {
let shadow = root();
let edit = new GuiButton('Edit rocket', events.editShip, 0, 0, 200);
shadow.append(edit);
edit.posRelative({ x: 0.5, xc: 0.5, y: 1 });
edit.y -= 45;
edit.tick = () => {
edit.options.draw = state.landed && !state.editing;
}
return shadow;
}