So, I've got a line of buttons, and I've got an array where each button is assigned to an index of that array, like
array[1] =$Button1
array[2] =$Button2
array[3] =$Button3
array[4] =$Button4
and I've got a for loop like this,
for index in range(1, 4)
if array[index].is_pressed() == true:
array[index].set_pressed(false)
if not index-1 < 1:
array[index-1].set_pressed(true)
and this works to move the pressed button down one, but if I try almost the exact same thing,
for index in range(1, 4)
if array[index].is_pressed() == true:
array[index].set_pressed(false)
if not index+1 > 4:
array[index+1].set_pressed(true)
it just does not work. It unpresses the button on array[index], but does not press the button on array[index+1]
Am I missing something or doing something wrong? I'm not exactly a professional so my first assumption is that I have to be missing something stupid.