This commit is contained in:
James Turk 2023-04-30 06:10:30 -05:00
parent a50055ba4f
commit 18906ce575
2 changed files with 80 additions and 34 deletions

View File

@ -1,6 +1,12 @@
set shell := ["fish", "-c"]
clean: clean:
-rm *.p8l -rm *.p8l
save message: save message:
git commit -m "{{message}}" git commit -m "{{message}}"
git push git push
build target:
pico8 -export index.html games/{{target}}.p8
zip -r {{target}}.zip index.html index.js

View File

@ -10,8 +10,8 @@ function _init()
palt(11, true) palt(11, true)
palt(0, false) palt(0, false)
-- start first scene -- start first scene
start_level(1) start_scene("explainer")
--start_scene("explainer") --start_scene("ending")
end end
function _update() function _update()
@ -328,6 +328,9 @@ function update_exp_grid(x, y)
if explode.countdown == 0 then if explode.countdown == 0 then
-- always add particles and destroy box -- always add particles and destroy box
add_particles(x, y, explode.colors) add_particles(x, y, explode.colors)
if puzzle_grid[y][x] != 0 then
level_boxes -= 1
end
puzzle_grid[y][x] = 0 puzzle_grid[y][x] = 0
if explode.colors ~= explosion_types.fire then if explode.colors ~= explosion_types.fire then
@ -411,17 +414,22 @@ function update_level()
and puzzle_grid[y+1][x] == 0 and puzzle_grid[y+1][x] == 0
and puzzle_grid[y][x] != 0 and puzzle_grid[y][x] != 0
then then
puzzle_grid[y+1][x] = puzzle_grid[y][x]
puzzle_grid[y][x] = 0
sfx(1)
-- crushed, explode -- crushed, explode
if y+1 == bomb_y and x == bomb_x then if y+1 == bomb_y and x == bomb_x then
explode() explode()
puzzle_grid[y+1][x] = 0 puzzle_grid[y+1][x] = 0
level_boxes -= 1
end end
puzzle_grid[y+1][x] = puzzle_grid[y][x]
puzzle_grid[y][x] = 0
sfx(1)
end end
end end
end end
if level_boxes <= 0 and bomb_y == GRID_H then
start_level(level_num+1)
end
end end
-- movement -- movement
@ -451,14 +459,14 @@ function update_level()
end end
-- DEBUG LEVEL SELECT -- DEBUG LEVEL SELECT
if btnp(⬇️) then -- if btnp(⬇️) then
level_num = max(level_num-1, 1) -- level_num = max(level_num-1, 1)
start_level(level_num) -- start_level(level_num)
end -- end
if btnp(⬆️) then -- if btnp(⬆️) then
level_num = min(level_num+1, #levels) -- level_num = min(level_num+1, #levels)
start_level(level_num) -- start_level(level_num)
end -- end
end end
function explode() function explode()
@ -467,6 +475,36 @@ function explode()
level_dets += 1 level_dets += 1
end end
function start_ending()
exp_spr = make_sprite(50, 50, "boy_back", 0.2)
exp_spr.speed = 0.4
exp_spr.loop = false
exp_spr.vx = .3
exp_spr.vy = .02
end
function update_ending()
update_sprite(exp_spr)
end
function draw_ending()
draw_dusk()
map(18, 0, 0, 16, 16, 8)
draw_sprite(exp_spr)
local st = scene_time()
print("the boy conquered nasa and", 10, 80, 7)
if st > 1 then
print("thwarted their plans for")
end
if st > 2 then
print("solar system domination...")
end
if st > 5 then
print("\nwhat awaits our hero next?")
end
end
-- globals -- globals
_scene = nil _scene = nil
_scenes = {} _scenes = {}
@ -475,6 +513,7 @@ _scene_start = 0
_scenes.title = {start=nil, draw=draw_title, update=update_title} _scenes.title = {start=nil, draw=draw_title, update=update_title}
_scenes.explainer = {start=start_explainer, draw=draw_explainer, update=update_explainer} _scenes.explainer = {start=start_explainer, draw=draw_explainer, update=update_explainer}
_scenes.level = {start=nil, draw=draw_level, update=update_level} _scenes.level = {start=nil, draw=draw_level, update=update_level}
_scenes.ending = {start=start_ending, draw=draw_ending, update=update_ending}
total_dets = 0 total_dets = 0
@ -493,7 +532,8 @@ animations = {
boy_walk={frames={[0]=2, 0, 4, 0}, w=2, h=2}, boy_walk={frames={[0]=2, 0, 4, 0}, w=2, h=2},
boy_bomb={frames={[0]=32, 34, 36, 38, 40, 42, 44, 46}, w=2, h=2}, boy_bomb={frames={[0]=32, 34, 36, 38, 40, 42, 44, 46}, w=2, h=2},
bomb_s={frames={[0]=64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76}, w=1, h=1}, bomb_s={frames={[0]=64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76}, w=1, h=1},
bomb_m={frames={[0]=80, 82, 84, 86, 88, 90, 92}, w=2, h=2} bomb_m={frames={[0]=80, 82, 84, 86, 88, 90, 92}, w=2, h=2},
boy_back={frames={[0]=46,44,42,40,38,36,34,32}, w=2, h=2},
} }
-- globals -- globals
@ -575,20 +615,20 @@ bbb88bb88b88b88b88885bb88b88bbbbbbb88b448b88b844444444b88bbbbbbb0055550044ffff44
bbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbbbbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbb0000000044444444555555554444444455555555555555555555555500000000 bbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbbbbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbb0000000044444444555555554444444455555555555555555555555500000000
bb6666666666666666666666666666bbbb666666666666666666666666b5bbbb0000000000000000000000000000000000000000000000000000000000000000 bb6666666666666666666666666666bbbb666666666666666666666666b5bbbb0000000000000000000000000000000000000000000000000000000000000000
bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb666666666666666666666666665bbb00bbbb0000000000000000000000000000000000000000000000000000000000 bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb666666666666666666666666665bbb00bbbb0000000000000000000000000000000000000000000000000000000000
bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c646c6c6c6c6646c6c6c6b6b6bbb0bb0000000000000000000000000000000000000000000000000000000000000 bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c646c6c64646646c6c6c6b6b6bbb0bb0000000000000000000000000000000000000000000000000000000000000
bb6666666666666666666666666666bbbb66c646c6c6c6c6646c6c6c6b6b66bb0bbb000000000000000000000000000000000000000000000000000000000000 bb6666666666666666666666666666bbbb66c646c6c6c6c6646c646c6b6b66bb0bbb000000000000000000000000000000000000000000000000000000000000
bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb6666666666666666666666666666bb000bbb0000000000000000000000000000000000000000000000000000000000 bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb6666666666666666666666666666bb000bbb0000000000000000000000000000000000000000000000000000000000
bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c646c6c66c6c6c646c6c66bb00000b0000000000000000000000000000000000000000000000000000000000 bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c64646c66c6c64646c6c66bb00000b0000000000000000000000000000000000000000000000000000000000
bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c646c6c66c6c6c646c6c66bb0bbbbb0000000000000000000000000000000000000000000000000000000000 bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c6c6c64646c66c6464646c6c66bb0bbbbb0000000000000000000000000000000000000000000000000000000000
bb6666666666666666666666666666bbbb66c6c6c646c6c66c6c6c646c6c66bb00bb000000000000000000000000000000000000000000000000000000000000 bb6666666666666666666666666666bbbb66c6c6c64646c66c6464646c6c66bb00bb000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000006645bbbb0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000006666bbbb0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000646bbbbb0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000064bbbbbb0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000006bbbbbbb0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000006bbbbbbb0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000006b6bbbbb0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000006654bbbb0000000000000000000000000000000000000000000000000000000000000000
66666666666666663333333300000000000000000000000000000000000000006666666600000000000000000000000000000000000000000000000000000000 66666666666666663333333300000000000000000000000000000000000000006666666600000000000000000000000000000000000000000000000000000000
33333333333333333333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 33333333333333333333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333335335333333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 33333333335335333333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@ -752,13 +792,13 @@ __label__
22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
__map__ __map__
0000000000000000000000008081828380818200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000808182832f2f2f2f2f2f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000070000009091929390919200000084858687000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000007000000909192932f2f2f2f2f2f84858687000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000b170a00009091929390919200000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000b170a0000909192932f2f2f2f2f2f94959697000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000061b891a08009091929390919200000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000061b891a0800909192932f2f2f2f2f2f949696a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000001689898918009091929390919200000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000168989891800909192932f2f2f2f2f2f949596a7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
b2b2b2b2b2b2b2b2b2b8b8b8b8b8b8b80000000000b8b8b8b8b8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 b2b2b2b2b2b2b2b2b2b8b8b8b8b8b8b80000b2b2b2b8b8b8b8b8b8b8b8b80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
b2b2b2b2b2b2b2b2b2b0b0b0b0b0b0b00000000000b0b0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 b2b2b2b2b2b2b2b2b2b0b0b0b0b0b0b0b0b0b2b2b2b0b0b0b1b0b0b0b0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
c0c1c1c1c1c1c1c1c1c2c3c4c4c4c4c5888888888888888800008888888888888888000000000000000000000000000000000000000000008b8b8b8b8b8b8b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 c0c1c1c1c1c1c1c1c1c2c3c4c4c4c4c5888888888888888800008888888888888888000000000000000000000000000000000000000000008b8b8b8b8b8b8b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
d0d1d1d1d1d1d1d1d1d2e3e4e4e4e4e5000000000000000000008800888888888888890089000000008900000000000000000000000000008b8b8b8b8b8b8b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 d0d1d1d1d1d1d1d1d1d2e3e4e4e4e4e5000000000000000000008800888888888888890089000000008900000000000000000000000000008b8b8b8b8b8b8b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000