-2

How do I make shapes to burst or disappear when it intersects with a rectangle2D(bullet). Bursting will be preferable since I am developing a shooting game. I want the rectangle to burst or disappear when the bullet (another rectangle) intersects or hits it. Someone please help me with this. Thanks in Advance.

doldt
  • 4,466
  • 3
  • 21
  • 36

1 Answers1

1

Burst: you replace Rectangle object with 4 lines that make up the rectangle and move them in different directions, thus creating burst effect.

Disappear: you simply stop drawing the Rectangle object once it collides

AlmasB
  • 3,377
  • 2
  • 15
  • 17