added constarin to iInput
This commit is contained in:
@@ -80,6 +80,7 @@ function score() {
|
||||
function gameOver() {
|
||||
if (lives == 0) {
|
||||
//game over screen
|
||||
iIndex = constrain(iIndex, 0, 2);
|
||||
isDead = true;
|
||||
push();
|
||||
fill(255, 0, 0);
|
||||
@@ -137,7 +138,7 @@ async function keyPressed() {
|
||||
}
|
||||
}
|
||||
if (isDead && keyReleasedFlag) {
|
||||
if ((iIndex < 2) || (iIndex > 0)) {
|
||||
if ((!(iIndex > 2)) || (!(iIndex < 0))) {
|
||||
if (keyCode == LEFT_ARROW) {
|
||||
iIndex -= 1;
|
||||
keyReleasedFlag = false;
|
||||
|
Reference in New Issue
Block a user