diff --git a/games/baggage.p8 b/games/baggage.p8 new file mode 100644 index 0000000..6df9e26 --- /dev/null +++ b/games/baggage.p8 @@ -0,0 +1,164 @@ +pico-8 cartridge // http://www.pico-8.com +version 41 +__lua__ +-- +function _init() + start_scene("title") +end + +function _update() + if _scene and _scene.update then + _scene.update() + end +end + +function _draw() + if _scene and _scene.draw then + _scene.draw() + end +end + +function start_scene(name) + _scene = _scenes[name] + _scene_start = time() + if _scene.start then + _scene.start() + end +end + +function scene_time() + return time() - _scene_start +end + +_scene = nil +_scenes = {} +_scene_start = 0 + +function draw_title() + cls() + spr(64, 10, 30, 16, 4) + print("the home video arcade game", 5, 70, 8) +end + +function update_title() + if scene_time() > 1 then + start_scene("menu") + end +end + +function draw_jerry(x, y, glasses_y, mouth) + spr(1, x, y, 4, 4) + spr(21, x+8, y+9-glasses_y, 2, 1) + if mouth == "talking" then + spr(5+(t()*3)%4, x+14, y+16) + elseif mouth == "shocked" then + spr(9, x+14, y+16) + else + spr(6, x+14, y+16) + end +end + +function draw_bag(bag, open, x, y) + -- small + local n = 11 + local h = 1 + if bag == 2 then + n = 27 + h = 2 + elseif bag == 3 then + n = 23 + h = 3 + end + if not open then + n += 2 + end + spr(n, x, y+8*(3-h), 2, h) +end + + +function draw_menu() + cls(1) + palt(0, false) + palt(11, true) + + rectfill(0, 90, 128, 128, 2) + draw_jerry(5, 96, (t())%6, "talking") + + draw_bag(1, false, 20, 20) + draw_bag(2, false, 60, 20) + draw_bag(3, false, 100, 20) +end + +function update_menu() +end + +-- globals +_scenes.title = {start=nil, draw=draw_title, update=update_title} +_scenes.menu = {start=nil, draw=draw_menu, update=nil} + + +__gfx__ +00000000bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb888888bb888888bb88888bbb88888bbb88888bbbbbbbbbbbbbbb66666666bbbbbbbbb666666bbbbbbbbbbbbb +00000000bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb888888bb877778bb88888bbb87778bbb80008bbbbbbbbbbbbb555555555555bbbbbb66bbbb66bbbbbbbbbbbb +00700700bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb888888bbbbbbbbbb88888bbb80008bbbbbbbbbbbbb500000000005bbbb555055550555bbbbbbbbbb +00077000bbbbbbbbb6666666666666bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb88888bbbbbbbbbbbbb500000000005bbbb555555555555bbbbbbbbbb +00077000bbbbbbbbb66666666666666bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb500000000005bbbb555555555555bbbbbbbbbb +00700700bbbbbbbb66666666fffff666bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb500000000005bbbb555555555555bbbbbbbbbb +00000000bbbbbb666666ffffffffff66bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb500000000005bbbb555555555555bbbbbbbbbb +00000000bbbbbb66666ffffffffffff6bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb5555555555bbbbb555555555555bbbbbbbbbb +00000000bbbbbbbbb6ff6666ff666ff6bbbbbbbbbbbbbbbbbbbbbbbbbbb5555555555bbbbbb5555555555bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bbbbbbbbf6ff6677ff7766f6fbbbbbbbcccccccccccccbbbbbb565bbbb565bbbbbb565bbbb565bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bbbbbbbbf6fff700ff700ff6fbbbbbbbcbbbcbbcbcbbccccbbbb6bbbbbb6bbbbbbbb6bbbbbb6bbbbbb555555555555bbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bbbbbbbbfffff700ff700ffffbbbbbbbbbbbcbbcbcbbcbbbbbbb6bbbbbb6bbbbbbbb6bbbbbb6bbbbbb566666666665bbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bbbbbbbbbbfffffffffffffbbbbbbbbbbbbbccccbccccbbbbbbb6bbbbbb6bbbbbbbb6bbbbbb6bbbbb56000600600065bbbbbbbbbbbbbbbbbbbbbbbbb +00000000bbbbbbbbbbfffffffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbbbb6bbbbbb6bbbbbbbb6bbbbbb6bbbbb55000066000055bb55555555555555bbbbbbbbb +00000000bbbbbbbbbbfffffffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbb555555555555bbbb555555555555bbb55000000000055bb55555555555555bbbbbbbbb +00000000bbbbbbbbbbfffffffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbb555555555555bbbb555555555555bbb55000000000055bb55555555555555bbbbbbbbb +00000000bbbbbbbbbbbfffffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55555555555555bb55000000000055bb55555555555555bbbbbbbbb +00000000bbbbbbbbbbbfffffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bb65000000000056bb66666666666666bbbbbbbbb +00000000bbbbbbbbbbbfffffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bb55000000000055bb00000600600000bbbbbbbbb +00000000bbbbbbbbbbbbfffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bb55555555555555bb55005666650055bbbbbbbbb +00000000bbbbbbbbbbbbfffffffffbbbbbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bb55555555555555bb55555555555555bbbbbbbbb +00000000bbbbbbbbbbbbbfffffffbbbbbbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bb55555555555555bb55555555555555bbbbbbbbb +00000000bbbbbbbbbb7bbfffffffbbb7bbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bb55555555555555bb55555555555555bbbbbbbbb +00000000bbbbbbbbbb77bffffffff777bbbbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bb55555555555555bb55555555555555bbbbbbbbb +00000000bbbbbbbb55777ffffffff77755bbbbbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bbbb5555555777ffffff777755555bbbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bbb5555555577777ff777775555555bbbbbbbbbbbbbbbbbbb55000000000065bb55656565656555bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bb55555555557777767777755555555bbbbbbbbbbbbbbbbbb55000000000065bb55555555555555bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000bb555555555557777767777555555555bbbbbbbbbbbbbbbbb55555555555555bb55555555555555bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000b5555555555557777767777555555555bbbbbbbbbbbbbbbbbb555555555555bbbb555555555555bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000b5555555555557777567777555555555bbbbbbbbbbbbbbbbbbb00bbbbbb00bbbbbb00bbbbbb00bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +0000000055555555555555777766777555555555bbbbbbbbbbbbbbbbbbb00bbbbbb00bbbbbb00bbbbbb00bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +00000000000000000000000000000000000000777777777777777777777000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000777777777777777777777700000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000007700000000000000000000770000000000000000000000000000000000000000000000000000000000000000000 +07777777777770007777777777777777777777777777777777777777777777777777777777777777777077777777000000000000000000000000000000000000 +07777777777777000000000000000000000000000000000000000000000000000000000000000000000077777777000000000000000000000000000000000000 +07770000000077000000000000000000000000000000000000000000000000000000000000000000000077000000000000000000000000000000000000000000 +07770000000077000000777700000000777777770000077777777000000007777000000007777777700077000000000000000000000000000000000000000000 +07770000000077000000777700000007777777777000777777777700000007777000000077777777770077000000000000000000000000000000000000000000 +07770000000077000000770770000007700000077000770000007700000007707700000077000000770077000000000000000000000000000000000000000000 +07770000000077000007770770000007700000000000770000000000000077707700000077000000000077000000000000000000000000000000000000000000 +07770000000077000007700077000007700000000000770000000000000077000770000077000000000077000000000000000000000000000000000000000000 +07770000000077000007700077000007700000000000770000000000000077000770000077000000000077000000000000000000000000000000000000000000 +07770000000077000077700077000007700000000000770000000000000777000770000077000000000077000000000000000000000000000000000000000000 +07777777777770000077000007700007700000000000770000000000000770000077000077000000000077777777000000000000000000000000000000000000 +07777777777770000077000007700007700000000000770000000000000770000077000077000000000077777777000000000000000000000000000000000000 +07770000000077000077000007700007700000000000770000000000000770000077000077000000000077000000000000000000000000000000000000000000 +07770000000077000777777777770007700000000000770000000000007777777777700077000000000077000000000000000000000000000000000000000000 +07770000000077000777777777770007700777777000770777777700007777777777700077077777770077000000000000000000000000000000000000000000 +07770000000077000770000000770007707777777700770777777770007700000007700077077777777077000000000000000000000000000000000000000000 +07770000000077000770000000770007700000007700770000000770007700000007700077000000077077000000000000000000000000000000000000000000 +07770000000077007700000000770007700000007700770000000770077000000007700077000000077077000000000000000000000000000000000000000000 +07770000000077007700000000077007700000007700770000000770077000000000770077000000077077000000000000000000000000000000000000000000 +07770000000077007700000000077007700000007700770000000770077000000000770077000000077077000000000000000000000000000000000000000000 +07777777777777007700000000077007777777777000777777777700077000000000770077777777770077000000000000000000000000000000000000000000 +07777777777770007700000000077000777777770000077777777000077000000000770007777777700077777777000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000077777777000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +07777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +07777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777000000000000000000000000000000000000