Processing to P5.js

I am trying to convert my Processing project to P5.js, however I’ve run into a bunch of errors with an object not being defined and “unexpected identifiers”. The original Processing code works fine.

Would someone please diagnose my JavaScript syntax? I’ve shared both project versions.

P5.js:

Processing4:

In the p5.js code, what is this that you have within the parentheses of line 24 of ball.js?:

  checkPaddle(Paddle paddle) {

While in Java, you need to declare the types of the parameters in a function or method definition, that should not be done in p5.js.

2 Likes