How to check a function for every single array

You are doing it wrong.

a)

Is collideType initially == -1? Because when it’s 0, you will always have a collision type 0

b)

when you have a collision you set collideType ; but then you check the next platform and maybe there is also a collision?

You could let collisionplatform return a boolean indicating whether we had a collision here

c)

  boycollision (b, p[i]);

is after the for loop; you want to evaluate the global collideType , so it’s okay, that’s after the for-loop } but then store your i in the for-loop as i_Collision and use i_Collision after the for-loop

Chrisir