From ce1cf303d55f4ac7e2b4b2e0ebdaf4e45e4b10bf Mon Sep 17 00:00:00 2001 From: James Turk Date: Sat, 29 Apr 2023 23:11:58 -0500 Subject: [PATCH] actual levels --- games/boybomb.p8 | 76 +++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/games/boybomb.p8 b/games/boybomb.p8 index ad6fb29..8e4e708 100644 --- a/games/boybomb.p8 +++ b/games/boybomb.p8 @@ -10,8 +10,8 @@ function _init() palt(11, true) palt(0, false) -- start first scene - --start_level(1) - start_scene("explainer") + start_level(1) + --start_scene("explainer") end function _update() @@ -161,8 +161,19 @@ end levels = { {name="lobby 1", - mapx=16, mapy=8, bomb_x=6, bomb_y=7, + mapx=16, mapy=8, par=2, boss=8, + message="there's no way he'll\nclear these boxes" + }, + {name="lobby 2", + mapx=25, mapy=8, + par=2, boss=8, + message="this one should take a\ndozen explosions" + }, + {name="lobby 3", + mapx=31, mapy=8, bomb_x=6, bomb_y=7, + par=2, boss=8, + message="maybe he'll wear himself\nout?" }, {name="lab 1", mapx=26, mapy=8, bomb_x=6, bomb_y=7, @@ -177,6 +188,8 @@ function start_level(n) level_boxes = 0 level_num = n level = levels[n] + bomb_x = 4 + bomb_y = 4 -- load puzzle puzzle_grid = {} for y=1,GRID_H do @@ -185,13 +198,15 @@ function start_level(n) puzzle_grid[y][x] = mget(x+level.mapx-1, y+level.mapy-1) if puzzle_grid[y][x] == GRID_EMPTY then puzzle_grid[y][x] = 0 + elseif puzzle_grid[y][x] == GRID_START then + puzzle_grid[y][x] = 0 + bomb_x = x + bomb_y = y elseif puzzle_grid[y][x] ~= 0 then level_boxes += 1 end end end - bomb_x = level.bomb_x - bomb_y = level.bomb_y bomb_spr = make_sprite(bomb_x*8, bomb_y*8, "bomb_s", 0) end @@ -249,7 +264,7 @@ function draw_level() print("chain "..10, jx, 40, 11) print("crates "..level_boxes, jx, 48, 11) spr(level.boss, 10, 108, 1, 2) - print("stay still and don't \nexplode. we're here to help", 20, 110, 7) + print(level.message, 20, 110, 7) bomb_spr.x = bomb_x * 8 bomb_spr.y = bomb_y * 8 @@ -420,6 +435,7 @@ total_dets = 0 GRID_W = 8 GRID_H = 11 GRID_EMPTY = 136 +GRID_START = 152 BOX_WOOD = 137 BOX_STEEL = 138 BOX_FIRE = 139 @@ -506,21 +522,21 @@ cc77cc77bbbb55555555bbbbbbbbbbbb555555555654456555444455c4ffff47c5665657c53ea157 cc77cc77bbbb55555555bbbb55555555bbbbbbbbb556655bbbbbbbbbc4ffff47c5555557c5555557c4444447c4363f4755555555000000000000000000000000 cc77cc77bbbb55555555bbbb55555555bbbbbbbb6b5555b6bbbbbbbbc4444447cc77cc77cc77cc77cc444477c4444447c5555557000000000000000000000000 bbbbbbbbbbbbbbbbbb8888bbbbbbbbbbbbbbbbbb444bbbb4444888bbbbbbbbbb0000000044444444555555554444444455555555555555555555555500000000 -bbbbbbbbbbbbbbbbb8888bbbbbbbbbbbbbbbb447774bbbb4ee44444444bbbbbb0077770044ffff4455dddd55449999445577775550aaaa055cccccc500000000 -bbb88bb88bb888bb88bb5bbb888bbbbbbbb44ee747488bb777e47474448bbbbb077007704f4ff4f45d5dd5d54989989457373775500aa0055111ccc500000000 -bbb888b88b88888b88888bb88888bbbbbbb844e777748b874744747e4488bbbb070777704ff44ff45dd55dd549988994577bb37550a00a05511111c500000000 -bbb888888b88b88bbbbb88b88b88bbbbbbb884e74d74b887774447e44488bbbb070000004ff44ff45dd55dd549988994577bb3755aa00aa55cc1111500000000 -bbb88b888b88888bb88888b88888bbbbbbb884477774b84444e77444448bbbbb077000004f4ff4f45d5dd5d549899894573737755a0000a55ccc111500000000 -bbb88bb88b88b88b88885bb88b88bbbbbbb88b448b88b844444444b88bbbbbbb0077770044ffff4455dddd554499994455777755500000055cccccc500000000 +bbbbbbbbbbbbbbbbb8888bbbbbbbbbbbbbbbb447774bbbb4ee44444444bbbbbb0055550044ffff4455dddd55449999445577775550aaaa055cccccc500000000 +bbb88bb88bb888bb88bb5bbb888bbbbbbbb44ee747488bb777e47474448bbbbb055005504f4ff4f45d5dd5d54989989457373775500aa0055111ccc500000000 +bbb888b88b88888b88888bb88888bbbbbbb844e777748b874744747e4488bbbb050555504ff44ff45dd55dd549988994577bb37550a00a05511111c500000000 +bbb888888b88b88bbbbb88b88b88bbbbbbb884e74d74b887774447e44488bbbb050000004ff44ff45dd55dd549988994577bb3755aa00aa55cc1111500000000 +bbb88b888b88888bb88888b88888bbbbbbb884477774b84444e77444448bbbbb055000004f4ff4f45d5dd5d549899894573737755a0000a55ccc111500000000 +bbb88bb88b88b88b88885bb88b88bbbbbbb88b448b88b844444444b88bbbbbbb0055550044ffff4455dddd554499994455777755500000055cccccc500000000 bbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbbbbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbb0000000044444444555555554444444455555555555555555555555500000000 bb6666666666666666666666666666bbbb666666666666666666666666b5bbbb0000000000000000000000000000000000000000000000000000000000000000 -bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb666666666666666666666666665bbb0000000000000000000000000000000000000000000000000000000000000000 -bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c646c6c6c6c6646c6c6c6b6b6bbb0000000000000000000000000000000000000000000000000000000000000000 -bb6666666666666666666666666666bbbb66c646c6c6c6c6646c6c6c6b6b66bb0000000000000000000000000000000000000000000000000000000000000000 -bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb6666666666666666666666666666bb0000000000000000000000000000000000000000000000000000000000000000 -bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c646c6c66c6c6c646c6c66bb0000000000000000000000000000000000000000000000000000000000000000 -bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c646c6c66c6c6c646c6c66bb0000000000000000000000000000000000000000000000000000000000000000 -bb6666666666666666666666666666bbbb66c6c6c646c6c66c6c6c646c6c66bb0000000000000000000000000000000000000000000000000000000000000000 +bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb666666666666666666666666665bbb00bbbb0000000000000000000000000000000000000000000000000000000000 +bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c646c6c6c6c6646c6c6c6b6b6bbb0bb0000000000000000000000000000000000000000000000000000000000000 +bb6666666666666666666666666666bbbb66c646c6c6c6c6646c6c6c6b6b66bb0bbb000000000000000000000000000000000000000000000000000000000000 +bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb6666666666666666666666666666bb000bbb0000000000000000000000000000000000000000000000000000000000 +bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c646c6c66c6c6c646c6c66bb00000b0000000000000000000000000000000000000000000000000000000000 +bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c646c6c66c6c6c646c6c66bb0bbbbb0000000000000000000000000000000000000000000000000000000000 +bb6666666666666666666666666666bbbb66c6c6c646c6c66c6c6c646c6c66bb00bb000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 @@ -700,17 +716,17 @@ __map__ b2b2b2b2b2b2b2b2b2b8b8b8b8b8b8b80000000000b8b8b8b8b8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 b2b2b2b2b2b2b2b2b2b0b0b0b0b0b0b00000000000b0b0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -c0c1c1c1c1c1c1c1c1c2c3c4c4c4c4c5888888888888888800008c00000000008d8d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2e3e4e4e4e4e500000000000000000000890000000000898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2c3c4c4c4c4c500000000000000000000890000000000898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000890000000000898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000890000000000898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000890000000000898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000890000000000898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d300000000d588888800008888880000890000000000898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d300000000d5888888000088888800008b8b8b8b8b8b8b8b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d300000000d589888900008988890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -d0d1d1d1d1d1d1d1d1d2d3d4d4d4d4d589898b89008989890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +c0c1c1c1c1c1c1c1c1c2c3c4c4c4c4c588888888888888880000888888888888888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2e3e4e4e4e4e500000000000000000000880088888888888889008900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2c3c4c4c4c4c500000000000000000000880088888888888889988900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000888888888888888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000880000008888888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000880000000000888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d300000000d500000000000000000000880000000000888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d300000000d588888888888888880000880000000000888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d300000000d588888988898888880089889888888988888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d300000000d588888998898888880089888988888900888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +d0d1d1d1d1d1d1d1d1d2d3d4d4d4d4d588888989898888880089898989898988888889898900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 d0d1d1d1d1d1d1d1d1d2d3d4d4d4d4d500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 e0e1e1e1e1e1e1e1e1e2e3e4e4e4e4e500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 c3c4c4c4c4c4c4c4c4c4c4c4c4c4c4c500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000