Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

9 years ago by Gamma

Hello everyone. I have a problem with the Enemy entities that I have in my game. Instead of making the Entity "poof" away after it had been killed, how do I, instead, keep the Enemy in it's place with a "death" animation.

For example: You shoot a monster in front of you, and the monster is simply in the same place just dead and not moving at all, and the player simply keeps moving forward.

How would I be able to accomplish this?

9 years ago by Danb

As a quick method, When you check the death collision, change the enemy anim to your death one and make the collision of the enemy entity passive.

You'll probably want to clear them out at some point otherwise you'll potentially have lots lying around which could cause problems

9 years ago by drhayes

You could also make a EntityBadGuyDying and swap it out for your EntityBadGuy in its kill() method -- give it the same position as the one its replacing, etc.

Then the EntityBadGuyDying could kill() itself once its health reaches 0... which makes the health become a bit of a timer. Meanwhile, its death animation runs once to the end and doesn't loop.

9 years ago by Gamma

@Danb - I like your method, but the reason why I do this is because making the enemy just explode is the norm these days, it just gets a bit too tiring seeing that over and over. But I guess there would be performance issues if I kept them their. I think I'll just go with explosions. XD

9 years ago by Danb

@gamma - just clear them out at some acceptable interval

e.g. set a timer for a few secs when health is 0, use alpha fade them them out and when delta ==0 , enemy.kill();

or just harvest them out when x,y is off screen
Page 1 of 1
« first « previous next › last »