Preventing the player from cheating
Players will always try to cheat. When making a game, don't expect people to respect any policy of playing.
We must prevent the player from continuing to pick tiles when the script is waiting to let him see the second tile he picked.
We need another instance variable, of a new type. Change class level variables and constants by coding this way:
// class level variables and constants private var pickedTiles:Array = new Array(); private const NUMBER_OF_TILES:uint=20; private var pauseGame:Timer; private var canPick:Boolean=true; // end of class level variables and constants
Boolean variables can only have a
canPick variable will decide whether the player can pick another tile or not. Initially, ...