level select
This commit is contained in:
parent
f91b940b5d
commit
b75c5f7c16
@ -168,6 +168,7 @@ function start_level(n)
|
|||||||
last_gravity = t()
|
last_gravity = t()
|
||||||
exploding = false
|
exploding = false
|
||||||
|
|
||||||
|
level_num = n
|
||||||
level = levels[n]
|
level = levels[n]
|
||||||
puzzle_grid = {}
|
puzzle_grid = {}
|
||||||
for y=1,GRID_H do
|
for y=1,GRID_H do
|
||||||
@ -363,6 +364,17 @@ function update_level()
|
|||||||
if btnp(❎) then
|
if btnp(❎) then
|
||||||
explode()
|
explode()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- DEBUG LEVEL SELECT
|
||||||
|
if btnp(⬇️) then
|
||||||
|
level_num = max(level_num-1, 1)
|
||||||
|
start_level(level_num)
|
||||||
|
end
|
||||||
|
if btnp(⬆️) then
|
||||||
|
level_num = min(level_num+1, #levels)
|
||||||
|
start_level(level_num)
|
||||||
|
end
|
||||||
|
|
||||||
-- fall immediately
|
-- fall immediately
|
||||||
if bomb_y < GRID_H and puzzle_grid[bomb_y+1][bomb_x] == 0 then
|
if bomb_y < GRID_H and puzzle_grid[bomb_y+1][bomb_x] == 0 then
|
||||||
bomb_y += 1
|
bomb_y += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user