I have a game where you click the circles as they fall into the target, but right now I have it so they all just fall from left to right and so on. I want them to fall in a random order, but I have no clue how. Here is my code for it:
var alternator = 0
var flag:Bool = true
var fallTimer:NSTimer?
func fallCircleWrapper() {
if (flag == true) {
self.alternator += 1
} else {
self.alternator -= 1
}
if (self.alternator == 0) {
flag = true
} else if (self.alternator == 5) {
flag = false
}
self.hitAreaArray[self.alternator].emitNote(self.texture!)
}