Im a beginner programmer in java script (hobbyist) and im trying to replicate pong in the p5.js web editor. i have this problem that i cant solve with the player colision, i tried several things. i ahve the distance from the player to the ball but i dont know how to use that information to make a colision detection.
i provide you the code below:
https://editor.p5js.org/p3nd_/sketches/rkAEBmgeV
would be very happy if i would get help.