Add instructions

This commit is contained in:
asraelite 2018-03-07 15:56:10 +00:00
parent 60f77c36a9
commit 2959c39da7
10 changed files with 119 additions and 21 deletions

View file

@ -7,7 +7,7 @@ export let root;
export function init() {
elements.clear();
root = modules.root();
changeView('title');
changeView('menu');
}
export function tick() {
@ -17,13 +17,17 @@ export function tick() {
export function changeView(view) {
root.clear();
if (view == 'title') {
if (view === 'menu') {
root.append(modules.title());
}
if (view == 'game') {
if (view === 'game') {
root.append(modules.game());
}
if (view === 'instructions') {
root.append(modules.instructions());
}
}
export function measureText(msg, font) {