From 4f67b8307ba84786d0f16fd330b54ae55206aea7 Mon Sep 17 00:00:00 2001 From: JailDoctor Date: Wed, 25 Jan 2023 19:56:40 +0100 Subject: [PATCH] =?UTF-8?q?-=20Esbo=C3=A7ant=20els=20m=C3=B2duls=20b=C3=A0?= =?UTF-8?q?sics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- data/editor.lua | 7 +++++++ data/game.ini | 6 ++++++ data/main.lua | 40 ++++++++++++++++++++++++++++++++++++++++ data/mapa.lua | 19 +++++++++++++++++++ data/sprites.gif | Bin 1380 -> 1377 bytes 6 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 data/editor.lua create mode 100644 data/game.ini create mode 100644 data/main.lua create mode 100644 data/mapa.lua diff --git a/.gitignore b/.gitignore index f189855..a681663 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -draft/* \ No newline at end of file +draft/* +*.exe +mini +mini_debug diff --git a/data/editor.lua b/data/editor.lua new file mode 100644 index 0000000..0abf3c9 --- /dev/null +++ b/data/editor.lua @@ -0,0 +1,7 @@ +function editor_init() + set_update(editor_update) +end + +function editor_update() + +end \ No newline at end of file diff --git a/data/game.ini b/data/game.ini new file mode 100644 index 0000000..92c0d99 --- /dev/null +++ b/data/game.ini @@ -0,0 +1,6 @@ +title=Jail Adventure 2 +config=ja2 +width=160 +height=144 +zoom=5 +files=mapa.lua,editor.lua,main.lua diff --git a/data/main.lua b/data/main.lua new file mode 100644 index 0000000..8733910 --- /dev/null +++ b/data/main.lua @@ -0,0 +1,40 @@ +function _init() + menu_option=0 + sprites=loadsurf("sprites.gif") + tiles=loadsurf("tiles.gif") + setsource(tiles) + local pal=loadpal("tiles.gif") + setpal(pal) + set_update(menu_update) +end + +function set_update(new_update) + update=new_update +end + +function _update() + update() +end + +function menu_update() + cls() + color(1) + prnt("JAIL'S ADVENTURE 2",10,10) + color(4) if menu_option==0 then color(15) prnt(">",10,30) end + prnt("EDITOR",14,30) + color(4) if menu_option==1 then color(15) prnt(">",10,40) end + prnt("EIXIR",14,40) + + if btnp(KEY_DOWN) then menu_option=menu_option+1 end + if btnp(KEY_UP) then menu_option=menu_option-1 end + if menu_option<0 then menu_option=1 end + if menu_option>1 then menu_option=0 end + + if btnp(KEY_RETURN) then + if menu_option==0 then + editor_init() + elseif menu_option==1 then + quit() + end + end +end diff --git a/data/mapa.lua b/data/mapa.lua new file mode 100644 index 0000000..af03d0e --- /dev/null +++ b/data/mapa.lua @@ -0,0 +1,19 @@ +mapa={ + w=128, + h=128, + surface=nil, + + new = function(w,h) + mapa.w,mapa.h=w,h + if mapa.surface~=nil then freesurf(mapa.surface) end + mapa.surface=newsurf(w,h) + setmap(mapa.surface) + end, + + load = function(filename) + + end, + + save = function(filename) + end +} \ No newline at end of file diff --git a/data/sprites.gif b/data/sprites.gif index 7ee2b7127241f7902f12b4ed5463b743e4090575..b239b242a0f13f612bef417574f67c058cba70f5 100644 GIT binary patch delta 54 zcmV-60LlO43gHS6M@dFFH(`JPfB?h*0RI60u@G