We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I really need help on this project I have to finish within 5 hours. I have random circles coming down the screen, with a red circle in the middle. My goal is to make it so that if the Red circle comes in contact with any grey circle, they both disappear. Thank you so much for the help!
Answers
Line 34 should be on line 31, for a start.
How can you tell if two circles are touching? That is, what can you say about the distance between their centers (as it relates to their radii)?
What happens (or doesn't happen) to a grey circle when it is close enough to the red one? How can you remember that a grey one was close enough?
When should (or shouldn't) the red circle be drawn? Hint: Did you remember something?
I honestly don't have any idea, which is why I posted this discussion haha.
Notice you don't need line 27 as line 29 is the one that takes effect.
Notice the red dot needs to be drawn only once, so it can be outside of the for-loop. I am referring to line 33:
ellipse(xship, yship, 20, 20);
When there is a collision, you don't need to kill or delete your grey circle. Instead, you could re-init the circle exactly as what you are doing in lines 28 and 29.
However, I am not sure what should happen to your red dot. Should it completely disappear? One needs to show the red circle again so for the overlapping algorithm to be able to execute again. You will need to provide more details.
Kf
That is perfect, thank you! I know what to do now, I can take it from here.