Add instructions
This commit is contained in:
parent
60f77c36a9
commit
2959c39da7
10 changed files with 119 additions and 21 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue