For statement with Input.

Hi, new to for statements here. I’d like to use a for statement instead of tonnes of if statements which include arrays. This is one statement that I use.

		light.color = colour[0];

I’m using 2 array variables, one for keys ([0] is q right now). So when Q is pressed in-game, it changes the point light colour to the colour thats set at [0]. But for say, 25 keys ([24]), it’ll be if statement after if statement, which isn’t very neat. I feel that it can be shortened and I’d like to learn how.

Thank you, hope it’s understandable to read.

Seems like a for loop would work fine for this:

var i : int;
for( i = 0; i < 25; i++) {

light.color = colour*;*
break; //this line will optimize, but prevent from checking for simultaneous key presses