- Comence a implementar els moduls 'game' i 'actors'
This commit is contained in:
17
data/actors.lua
Normal file
17
data/actors.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
actors={
|
||||
list={},
|
||||
|
||||
add=function(actor)
|
||||
table.insert(actors.list, actor)
|
||||
end,
|
||||
|
||||
draw=function()
|
||||
for i,v in ipairs(actors.list) do
|
||||
sspr(v.gfx.x,v.gfx.y,16,16,v.x*8+v.dx,v.y*8+v.dy,16,16,v.o)
|
||||
end
|
||||
end,
|
||||
|
||||
update=function()
|
||||
|
||||
end
|
||||
}
|
||||
@@ -3,4 +3,4 @@ config=ja2
|
||||
width=160
|
||||
height=144
|
||||
zoom=5
|
||||
files=mapa.lua,editor.lua,textbox.lua,menu.lua,main.lua
|
||||
files=game.lua,mapa.lua,editor.lua,textbox.lua,menu.lua,main.lua
|
||||
|
||||
14
data/game.lua
Normal file
14
data/game.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
game={
|
||||
cam={x=0,y=0},
|
||||
|
||||
init=function()
|
||||
mapa.load("test.map")
|
||||
update=game.update
|
||||
end,
|
||||
|
||||
update=function()
|
||||
camera(game.cam.x, game.cam.y)
|
||||
map(0,0,0,0,mapa.w, mapa.h)
|
||||
camera(0,0)
|
||||
end
|
||||
}
|
||||
@@ -31,7 +31,7 @@ end
|
||||
function main_init()
|
||||
set_update(menu_update)
|
||||
second_menu = {{"PEIV", function() end},{"TORNAR",show_main_menu}}
|
||||
main_menu = { {"EDITOR", editor.init}, {"EIXIR", quit}, {"TEST", function() menu.show(second_menu) end } }
|
||||
main_menu = { {"JUGAR", game.init}, {"EDITOR", editor.init}, {"EIXIR", quit}, {"TEST", function() menu.show(second_menu) end } }
|
||||
show_main_menu()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user