Can anyone help me with my P5.JS code?

Hello everyone, I was just wondering if anyone could tell me how to add a collision detection into this Frogger game I made? I am completely stuck on how to add some collision detection and to reset the turtle to the top red rectangle. Thank you all for your time and help!
P5.Js code:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.