I have an array like
mypattern = [0,0,0,0];
and basically mypattern[0][0] = a, mypattern[0][1] = s and so on, its the keys a,s,d,f. So say i the array was [1,0,1,0] that means a and d would have to be down and your score would go up and the array would change. but how can i do that without having along script, heres what i tried:
if (mypattern[0][0] == 1 && Key.isDown(keys[0])) {
score += 100;
addblock([random(2), random(2), random(2), random(2)]);
} else if (mypattern[0][0] !== 1 && Key.isDown(keys[3])) {
score -= 100;
}
if (mypattern[0][1] == 1 && Key.isDown(keys[1])) {
score += 100;
addblock([random(2), random(2), random(2), random(2)]);
} else if (mypattern[0][1] !== 1 && Key.isDown(keys[3])) {
score -= 100;
}
if (mypattern[0][2] == 1 && Key.isDown(keys[2])) {
score += 100;
addblock([random(2), random(2), random(2), random(2)]);
} else if (mypattern[0][2] !== 1 && Key.isDown(keys[3])) {
score -= 100;
}
if (mypattern[0][3] == 1 && Key.isDown(keys[3])) {
score += 100;
addblock([random(2), random(2), random(2), random(2)]);
} else if (mypattern[0][3] !== 1 && Key.isDown(keys[3])) {
score -= 100;
}
and the keys is the ASCII i # of the keys so i wouldnt have to input each one.