8-way explosion
This commit is contained in:
parent
6e1c98d618
commit
e5d973f07f
@ -286,17 +286,26 @@ function process_block(x, y)
|
||||
add_explosion(x, y, {4, 15}) -- wood
|
||||
puzzle_grid[y][x] = GRID_EXPLODE
|
||||
elseif block == GRID_EXPLODE then
|
||||
local ys = {0}
|
||||
local xs = {0}
|
||||
if y > 1 then
|
||||
explosion_adjacent(x, y-1)
|
||||
add(ys, -1)
|
||||
end
|
||||
if y < GRID_H then
|
||||
explosion_adjacent(x, y+1)
|
||||
add(ys, 1)
|
||||
end
|
||||
if x > 1 then
|
||||
explosion_adjacent(x-1, y)
|
||||
add(xs, -1)
|
||||
end
|
||||
if x < GRID_W then
|
||||
explosion_adjacent(x+1, y)
|
||||
add(xs, 1)
|
||||
end
|
||||
for xx in all(xs) do
|
||||
for yy in all(ys) do
|
||||
if xx~=0 or yy~=0 then
|
||||
explosion_adjacent(x+xx, y+yy)
|
||||
end
|
||||
end
|
||||
end
|
||||
puzzle_grid[y][x] = 0
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user