Mouse collision with moving objects
in
Programming Questions
•
1 year ago
Hey all,
I'm currently in the process of writing a maze-like game, where the player guides their mouse pointer through a course of thin lines and moving objects without touching anything.
I am getting hung up on the collision of the moving balls that the player must avoid. I have made them move and bounce successfully, but I cannot figure out how to write the collision between the mouse pointer and the balls.
Ideally, when the pointer and one of the balls collide, the boolean gameStart would be set back to false, but I don't know how to define the collision for each ball's x and y coordinates, as they are defined in a for-loop all at once. I have tried my hand at writing objects for the balls and collision, but I just can't make it work.
If anyone could please lend this beginner a hand in helping to write this segment of code, and explain what I would have to do to move forward, it would be very much appreciated! I am trying to learn as much as I can about Processing while working on this project, and I've been loving (mostly) every minute of it. Any feedback at all is helpful.
1