How do I make my enemy explode?

Get help using Construct 2

Post » Tue Mar 31, 2015 11:18 am

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.
B
9
S
3
Posts: 103
Reputation: 1,043

Post » Tue Mar 31, 2015 11:19 am

Have it spawn a explosion sprite when it's destroyed.
B
15
S
4
G
1
Posts: 286
Reputation: 1,988

Post » Tue Mar 31, 2015 11:22 am

But how exactly? Whenever I do this, it kicks in before I even get a chance to shoot the enemy.
B
9
S
3
Posts: 103
Reputation: 1,043

Post » Tue Mar 31, 2015 12:21 pm

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)
B
15
S
4
G
1
Posts: 286
Reputation: 1,988

Post » Tue Mar 31, 2015 12:22 pm

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.
B
9
S
3
Posts: 103
Reputation: 1,043

Post » Tue Mar 31, 2015 3:21 pm

player bullet on collision with enemy
enemy destroy
enemy spawn new object Explosion
B
218
S
30
G
14
Posts: 1,889
Reputation: 37,594

Post » Tue Mar 31, 2015 6:13 pm

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.
B
10
S
1
Posts: 68
Reputation: 600

Post » Tue Mar 31, 2015 7:27 pm

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?
B
9
S
3
Posts: 103
Reputation: 1,043

Post » Tue Mar 31, 2015 9:19 pm

Do you have "Active at start" in your Fade behavior properties set to "No"? If not, it will start fading upon starting the game.
Moderator
B
106
S
41
G
20
Posts: 1,584
Reputation: 18,917

Post » Tue Mar 31, 2015 9:24 pm

Yes I tried both options yes and no and neither work.
B
9
S
3
Posts: 103
Reputation: 1,043

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 1 guest