How do I make a flak cannon?

0 favourites
  • 10 posts
From the Asset Store
Top down zombie survival mechanics pack in the style of Cannon Fodder.
  • Essentially, I want a bullet that, when it comes within certain range of something else, will explode and shoot off shrapnel. I've tried using Line of Sight and Distance, but nothing seems to work.

  • I'm not sure why checking the distance wouldn't work. Would you mind sharing a capx so see how you're working?

  • try

    bulletDestroy.capx

  • Essentially, I want a bullet that, when it comes within certain range of something else, will explode and shoot off shrapnel. I've tried using Line of Sight and Distance, but nothing seems to work.

    Like this? <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    https://www.dropbox.com/s/tazwmy30op246 ... .capx?dl=0

  • I'm not sure why checking the distance wouldn't work. Would you mind sharing a capx so see how you're working?

    Sure thing.

  • 1. Your first event is not picking any Flak objects in the conditions. All Flak objects will be destroyed if any of them are within 150 of rocket.

    2. In your loop, there are no Flaks to spawn shrapnel from because they all got destroyed in the previous event. In the same vein, you cannot set the properties of any shrapnel objects because none were created.

  • 1. Your first event is not picking any Flak objects in the conditions. All Flak objects will be destroyed if any of them are within 150 of rocket.

    2. In your loop, there are no Flaks to spawn shrapnel from because they all got destroyed in the previous event. In the same vein, you cannot set the properties of any shrapnel objects because none were created.

    Here's the thing, the Flak Objects are passing straight through the rocket without being destroyed.

    Furthermore, I've decided to try to tackle this issue in a different way: By having the Flak carry an instance variable that is the distance between the flak gun and the rocket which was targeted at the moment of firing. Then, when the flak has travelled that distance, it will explode.

    I am, however, having some problems with getting the x and y of the rocket targeted at the moment of firing. How do I go about that?

  • Don't use =

    ..should be = (greater than or equal)

  • I've gotten the shell to explode using line of sight. Turns out that I hadn't included the event sheet

    Now the problem is that the shrapnel is spawning all bunched up...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry for the double post, but I figured out what I was doing wrong:

    I was setting the direction of movement, when I should've been setting the angle of the shrapnel objects. It works fine now.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)