From 8087056c04938b19f0064af86979c7e877bcfe31 Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 16 Apr 2023 18:24:50 -0500 Subject: [PATCH] ocean --- games/ocean.p8 | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 games/ocean.p8 diff --git a/games/ocean.p8 b/games/ocean.p8 new file mode 100644 index 0000000..c4a5d99 --- /dev/null +++ b/games/ocean.p8 @@ -0,0 +1,68 @@ +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() + print("title " .. scene_time()) +end + +function update_title() + if scene_time() > 2 then + start_scene("menu") + end +end + +_scenes.title = {start=nil, draw=draw_title, update=update_title} + +function draw_ocean() + cls() +end + +function update_ocean() +end + +_scenes.menu = {start=nil, draw=draw_menu, update=nil} + + +__gfx__ +11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111171111111117111111111711111111170000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111117111111111171111111117111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111171111111117111111111171111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000