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

1 decade ago by Disdanes

Hey guys, I'm working on a 2D adventure game but I'm having some trouble with getting damage dealt correctly to my entities. Currently damage is dealt through the check function the entities have, but I'd like this to be called only once per collision as opposed to 30 times a second. Essientially when my character walks around and then attacks entities, the sword entity collides with a monster entity dealing 10 damage, but it happens so rapidly it ends up dealing 300 damage instead. Any suggestions on how to make this happen once until the next time the character attacks ?

1 decade ago by Arantor

I'd set a timer in ig.game (a reference to the game object), whereby you set it on the first attack collides, and if the timer is set and hasn't expired, return before any more damage is sent.

1 decade ago by Disdanes

Thanks Arantor, ill give that a shot

1 decade ago by paulh

can you help with how to implement:


return before any damage is dealt


struggling to do this myself?

want basically one hit entities which stop moving when hit by particles. I have it working but like disdanes , the particles hit the entity 7 or 8 times.

1 decade ago by paulh

solved spawned another entity!
Page 1 of 1
« first « previous next › last »