I still need a bomberman explosion engine in open source for TGF that works... I checked 1 out by Liquixcat, but it said: This is not a .GAM file even though it showed up as 1. If anyone has 1 please let me know.
Again, this is where I would recommend the fastloop - it makes some things so much easier. To begin with, you'll (obviously) need animations for the flame effects. You can be cheap here and just use one explosion effect, (that will be repeated for however many spaces). You will also need to lay out a bomberman-like play area, comprised of blocks (make them obstacles) of a certain size...for example, 32 by 32 pixels each. Be sure to lay them out correctly - using the 'snap to' grid helps here.
The actual 'code' would go something like this:
Upon pressing fire 1
• Create bomb object at 0,0 from player
If the number of bombs in play area is greater than 0
• Add 1 to alterable value A of bomb object (the bomb timer)
If value A of bomb object is greater than 150 (that's three seconds - every 50 is a second)
• create explosion object at 0,0 from bomb
• Position 'up explosion sensor' at 0,-32 from bomb
• Position 'down explosion sensor' at 0,32 from bomb
• Position 'left explosion sensor' at -32,0 from bomb
• Position 'right explosion sensor' at 32,0 from bomb
• Start loop 1 for 'bomb length' number of loops
Loop trigger 1
'up explosion sensor' is not overlapping an obstacle background
• create explosion at 0,0 from 'up explosion sensor'
• set y 'up explosion sensor' to y - 32
Loop trigger 1
'down explosion sensor' is not overlapping an obstacle background
• create explosion at 0,0 from 'down explosion sensor'
• set y 'down explosion sensor' to y + 32
Loop trigger 1
'left explosion sensor' is not overlapping an obstacle background
• create explosion at 0,0 from 'left explosion sensor'
• set x 'left explosion sensor' to x - 32
Loop trigger 1
'right explosion sensor' is not overlapping an obstacle background
• create explosion at 0,0 from 'right explosion sensor'
• set x 'right explosion sensor' to x + 32
If value A of bomb object is greater than 150 (that's three seconds - every 50 is a second)
• destroy bomb object
It might look a lot, but that's only about 7 events. The 'bomb length' is the name for a counter that determines...well, the bomb length. Set it to 3, and the explosions will travel three spaces from the bomb. Simple enough. The 'explosion sensor' objects that I've mentioned would be active objects. Just create four actives - up/down/left/right explosion sensor - which are a few pixels in size (very small), then make them invisible. These are used as 'sensors' to tell when the bomb blast should not travel any further in a direction.