dded constrain based on menu
This commit is contained in:
@@ -111,7 +111,7 @@ async function keyPressed() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (scorescreenOn && keyReleasedFlag) {
|
||||
if (scorescreenOn && keyReleasedFlag && entered) {
|
||||
buttonSelect = constrain(buttonSelect, 0, 1);
|
||||
if (keyCode == UP_ARROW) {
|
||||
buttonSelect -= 1;
|
||||
@@ -189,22 +189,27 @@ function wait(waitTime) {
|
||||
});
|
||||
}
|
||||
function nameSubmit() {
|
||||
iIndex = constrain(iIndex, 0, 2);
|
||||
if ((!(iIndex > 2)) || (!(iIndex < 0))) {
|
||||
if (keyCode == LEFT_ARROW) {
|
||||
console.log(iIndex);
|
||||
iIndex -= 1;
|
||||
keyReleasedFlag = false;
|
||||
}
|
||||
if (keyCode == RIGHT_ARROW) {
|
||||
console.log(iIndex);
|
||||
iIndex += 1;
|
||||
keyReleasedFlag = false;
|
||||
}
|
||||
}
|
||||
if (keyCode == UP_ARROW) {
|
||||
currentIndex[iIndex] = (currentIndex[iIndex] + 1) % letters.length;
|
||||
console.log(currentIndex[iIndex])
|
||||
keyReleasedFlag = false;
|
||||
}
|
||||
if (keyCode == DOWN_ARROW) {
|
||||
currentIndex[iIndex] = (currentIndex[iIndex] - 1 + letters.length) % letters.length;
|
||||
console.log(currentIndex[iIndex])
|
||||
keyReleasedFlag = false;
|
||||
}
|
||||
if (keyCode == ENTER) {
|
||||
|
Reference in New Issue
Block a user