Hi!
I am implementing explosion system to my 2d game, I think there should be 2 ways how to approach this
the bomb will execute script that checks which objects are in radius, then calculates the force to apply for each object and apply it. When i did this, only way i found was to iterate through the list of objects, which is very slow, how to do it fast?)
second method is to broadcast event from the bomb, every object then checks if it is in radius, then calculates and apply force on itself, i managed to do this without any problems, but it does not feel like best solution
my question is, what do you think would be best way to do this? I can think of combination of these two, (bomb checks for objects, then attach explode script to them which will destroy itself afterwards)
my concerns are, what happens when 2 bombs explode on same frame close to themselves, and how to do it fast, so overall design simplicity and niceness