I'm creating a game where the player has to avoid red balls for as long as possible. The red balls are flying around the screen in random directions and to do this, I've used the bullet and wrap behaviours.
One of the power-ups in my game is a magnetic bomb. What I want to do is when the player collects that, they can drop the bomb with a second touch and red balls are attracted to it as it's magnetic. After a few seconds and when multiple red balls are surrounding it, it will explode and destroy them.
I've set the red balls' angle of motion to the bomb when it's created but I don't know how to do the following:
1. When the player gets the power-up, use a second touch to drop the bomb anywhere on screen.
2. When red balls get to the bomb, I want them to hover around it until the timer finishes and it explodes. At the moment, they fly away from the bomb after a second or so, how would I get them to remain within 100 pixels of the X and Y of the bomb?
I've attached an image to show what I'm trying to achieve here.