akien-mga / dynadungeons

Bomberman clone using Godot Engine - Not actively developed since 2015.
GNU General Public License v3.0
217 stars 37 forks source link

Review (and maybe revamp) the bomb logic #25

Open akien-mga opened 9 years ago

akien-mga commented 9 years ago

The current bomb logic was written without much experience about how to do this stuff correctly, and I'm pretty sure my code could be improved a lot.

The main idea would be to reduce the complexity of the current algorithm, potentially also improving the way the flame animations are displayed. The simpler it gets, the better for us when we start implementing online multiplayer.

I don't have a precise idea about what needs to be done, but I'd like fresh eyes on the code to help me see what could be worked on.

The main logic is started from the trigger_explosion() code [1], which chains several helper functions to find all bombs that should be chained by the explosion of the initial bomb, and then display the animation accordingly.

[1] https://github.com/akien-mga/dynadungeons/blob/master/scripts/bomb.gd#L233-L255