I am creating a tiled game (2D top down) and I created explosions working this way:
The blue lines are walls, the white grid is accessable space. The red dot is the origin of the explosion with the green explosion radius. The orange lines are how I am doing raycasting (I am using Box2d) at the moment to ensure that only accessable things are hit (nothing behind the blue walls should be hit).
I cant just draw a circular sprite over the whole area as I dont want to let the explosion look like it is going over walls and stuff. My solution: I will draw an explosion tile over each tile that is in the radius.
This is how I want the explosion to look like:
Everything in the yellow "polygon" should be drawn as an explosion.
There are some issues seen here in the purple circles:
In "real life" the explosion will go around corners.
My question simply is: Do you have any idea on how to find all tiles that should be drawn as an explosion? Or maybe you do have a better approach!
The effect I want reminds me of minecraft water physics but in 2d.
Thank you!