Skip to content

Commit

Permalink
welcome screen bug
Browse files Browse the repository at this point in the history
moved instructions to hide welcome screen into the handlekeydown function
  • Loading branch information
gawainhewitt committed Jan 20, 2021
1 parent 24b6eaa commit b865238
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function hideLoadScreen() {
welcome.style.visibility="visible";
welcome.addEventListener("click", startHorn);
welcome.addEventListener("touchstart", startHorn);
welcome.addEventListener('keypress', startHorn);
}

function startHorn() {
Expand All @@ -64,6 +63,12 @@ function startHorn() {

function handleKeyDown(e) {

if(info === true) { // is the info screen on?
Tone.start(); // we need this to allow audio to start. probably best to put it on a different button soon though
info = false;
document.getElementById('welcomescreen').style.visibility="hidden";
}

var key = e.code;
console.log("keydown "+key); //debugging

Expand Down
7 changes: 6 additions & 1 deletion sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function hideLoadScreen() {
welcome.style.visibility="visible";
welcome.addEventListener("click", startHorn);
welcome.addEventListener("touchstart", startHorn);
welcome.addEventListener('keypress', startHorn);
}

function startHorn() {
Expand All @@ -64,6 +63,12 @@ function startHorn() {

function handleKeyDown(e) {

if(info === true) { // is the info screen on?
Tone.start(); // we need this to allow audio to start. probably best to put it on a different button soon though
info = false;
document.getElementById('welcomescreen').style.visibility="hidden";
}

var key = e.code;
console.log("keydown "+key); //debugging

Expand Down

0 comments on commit b865238

Please sign in to comment.