|
for (var i = 0; i < circles.length; i++) { |
|
physikz.updatePosition(circles[i]); |
|
game.checkCirclePosition(circles[i]); |
|
} |
Your update function is declared on line 52 and has its closing curly bracket on line 69. You originally wrote your physikz.updatePosition and game.checkCirclePosition function calls inside of your update function, so your code worked for 5 circles. However, the loop you added that now contains those functions calls is outside of the update function, which is causing your code to break.
If you move your for loop above the update function's closing curly bracket, you should be back to working code!
Pyrotechnic679.github.io/fsd-projects/circularity/js/init.js
Lines 70 to 73 in 4952f0b
Your update function is declared on line 52 and has its closing curly bracket on line 69. You originally wrote your
physikz.updatePositionandgame.checkCirclePositionfunction calls inside of your update function, so your code worked for 5 circles. However, the loop you added that now contains those functions calls is outside of the update function, which is causing your code to break.If you move your for loop above the update function's closing curly bracket, you should be back to working code!