- Esboçant els mòduls bàsics
This commit is contained in:
7
data/editor.lua
Normal file
7
data/editor.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
function editor_init()
|
||||
set_update(editor_update)
|
||||
end
|
||||
|
||||
function editor_update()
|
||||
|
||||
end
|
||||
6
data/game.ini
Normal file
6
data/game.ini
Normal file
@@ -0,0 +1,6 @@
|
||||
title=Jail Adventure 2
|
||||
config=ja2
|
||||
width=160
|
||||
height=144
|
||||
zoom=5
|
||||
files=mapa.lua,editor.lua,main.lua
|
||||
40
data/main.lua
Normal file
40
data/main.lua
Normal file
@@ -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
|
||||
19
data/mapa.lua
Normal file
19
data/mapa.lua
Normal file
@@ -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
|
||||
}
|
||||
BIN
data/sprites.gif
BIN
data/sprites.gif
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user