I am trying to make a sketch with falling squares and circles that collide with each other as well as the right and left wall and ground, but am having trouble with the sketch crashing as soon as pressing play, without even the background being drawn or giving any error messages.
Thank you so much ! This got the background to draw and error messages to show up!
Now I receive a “TypeError: object1.collideWithBoundaries is not a function at /sketch.js:51:13”, and if I comment out this line, there are a bunch of other errors. Is there something fundamentally wrong with the code?
Hi, thank you! I have one last question : now I receive the error “TypeError: v.copy is not a function”.
I’m using the variable v in the “applyImpulse”, however when I comment these out, the same error “v.copy is not a function” is given. Does this have to do with how I’m using p5.Vector.div and object1.applyForce(GRAVITY); ?