How do I make my enemy explode?

  • Well explode or fade anyway? I can't seem to figure out the right coding in the event sheet?! I got the part working where I shoot it with a bullet and it dissapears but that effect looks rubbish, so I am looking to figure out how to make the enemy fade or explode via an animation AFTER I have reduced the enemies health to zero with my bullets.

  • Have it spawn a explosion sprite when it's destroyed.

  • But how exactly? Whenever I do this, it kicks in before I even get a chance to shoot the enemy.

  • In events, choose [Enemy], choose "On destroyed", then [Enemy]: Spawn [Explosion] in the actions.

    (You also want to make the explosion disappear after its animation finishes, so something like [Explosion]: On any animation finished > Destroy)

  • I think this is similar to what I was doing with the fade in, let me try later when I am in front of that computer and I will let you know if such a way is more effective and works. Thanks for the help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • player bullet on collision with enemy

    enemy destroy

    enemy spawn new object Explosion

  • Yeah what lolpaca said should work because I'm pretty sure I'm using that same method or something close to it in my top down space shooter game. Long as you have some explosion animation images like a 7 frame exploding effect it should work but if you don't then of course it won't work because you have no animation images for the event you just made to work correctly.

  • Ok, forget about the explosion it just don't work. Going back to my original part of my question:

    I have:

    On Enemy Destroyed -> Start Fade

    But it always starts upon me starting the game? How do I delay it so that only when the enemy health falls below 0 that it starts the fade off? Perhaps someone could please show me in an example file?

  • Do you have "Active at start" in your Fade behavior properties set to "No"? If not, it will start fading upon starting the game.

  • Yes I tried both options yes and no and neither work.

  • I don't think "On enemy destroyed" > "Start fade" will work anyway, as the enemy is destroyed as the trigger so it no longer exists (correct me if I'm wrong, never used the fade function)

    The explosion method should work just fine though - I'm not sure why it wouldn't, what you're trying to do is pretty simple. I'd upload a .capx, but I use a bunch of plugins you probably don't have, so that could be problematic. Could you show (or write out) exactly the events you're using? It should go something like:

    [Enemy.Health] = 0

    [Enemy] Destroy

    [Enemy] On destroyed

    [Enemy] Spawn object [Explosion]

    [Explosion] On any animation finished

    [Explosion] Destroy

  • On start of layout set fade active = no

    player bullet hit enemy

    enemy start fade

    destroy player bullets

  • SomeT try this demos you will learn more

    https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0

  • Thanks I will give it a try later.

  • Most welcome SomeT

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