From b75c5f7c164cf7a17532ed7d82646bc9fc70851e Mon Sep 17 00:00:00 2001 From: James Turk Date: Tue, 25 Apr 2023 22:39:13 -0500 Subject: [PATCH] level select --- games/boybomb.p8 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/games/boybomb.p8 b/games/boybomb.p8 index dec232b..d366dd9 100644 --- a/games/boybomb.p8 +++ b/games/boybomb.p8 @@ -168,6 +168,7 @@ function start_level(n) last_gravity = t() exploding = false + level_num = n level = levels[n] puzzle_grid = {} for y=1,GRID_H do @@ -363,6 +364,17 @@ function update_level() if btnp(❎) then explode() 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 if bomb_y < GRID_H and puzzle_grid[bomb_y+1][bomb_x] == 0 then bomb_y += 1