Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Schmid committed May 30, 2015
1 parent e310738 commit 4ed2f5c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.as
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
public var input:Input;
public var newInput:Function;
private var newInputBackup:Function;
private var redecide:Boolean;

// handle connection to the arduino
var arduino:Arduino;
Expand Down Expand Up @@ -223,6 +224,7 @@
moveList.y = 150;

enableGoButton = false;
redecide = false;

addChild(moveList);

Expand Down Expand Up @@ -296,6 +298,7 @@
removeChild(tmp[0]);

lastInput();
redecide = true;
}
} else if (moves.length < 4) {
moves.push(input);
Expand Down Expand Up @@ -325,9 +328,10 @@
addChild(arrow);

nextInput();
if (moves.length < 4) {
if (moves.length < 4 && !redecide) { // only play when moves list not full and not redeciding
nextPlayerSounds[this.input.next].play();
}
redecide = false;
}
updateGoButton();
}
Expand Down

0 comments on commit 4ed2f5c

Please sign in to comment.