Explosion

 Author: Daniel Jackson

Because I am working on the weapons systems, I also have to create their effects such as a bleeding effect or doing explosions for the explosive weaponry. I finished the bleeding effect fairly quickly, but the explosion took slightly longer. Because the explosion persists after making contact with an enemy multiple collisions can occur. These collisions happen every frame doing the full damage over a thousand times a second (at the moment).

To fix this problem I created a map inside the explosion. Whenever an enemy came within the radius it was added to the map which associated a timer with that particular enemy. Now the timer is decremented by the time between frames and the enemy is only damaged when the allotted time is exceeded after which the timer is reset.









Comments

Popular posts from this blog

Adding assets to every enemy -- Owen Meyers

Sphere to AABB collision