Skip to content

Move for loop inside of update function #1

Description

@gregthompson27

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions