How do I use collision and distance simultaneously

0 favourites
  • 5 posts
  • I have completed the intro tutorial ghostshooter, and I am now adding features like bombs. Currently when a bullet collides with the bomb, all ghosts explode. How do I make it so that only ghosts at certain radius from the bomb explode (0-max range of bomb)?

  • Add this as a subevent of the event responsible for exploding the bomb:

    for each ghost

    system compare two values : distance(ghost.x,ghost.y,bomb.x,bomb.y) < max range of bomb

    ghost destroy

  • How can I do this? For each ghost can be used as an event/subevent. Compare two values is an event/subevent as well. How can use "system compare two values : distance(ghost.x,ghost.y,bomb.x,bomb.y) < max range of bomb" as an action of the subevent "for each ghost" ?

  • Hack:

    1. Create a circle sprite the size of your explosion radius and set its opacity to 50 for ease of use.

    2. Set it to invisible by default (left side properties).

    3. Spawn it at an image point center of the sprite "bomb" that goes off.

    4. Do Is-overlapping check and destroy anything is touches that needs to be kilt.

    5. Destroy radius sprite.

    Your game making has just been hacked!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)