37 lines
810 B
Lua
37 lines
810 B
Lua
require "mapa"
|
|
require "batman"
|
|
|
|
game = {
|
|
num = 1,
|
|
map_surf = {nil,nil},
|
|
|
|
init = function(level)
|
|
game_update = game.update
|
|
mapa.load(level)
|
|
batman.init()
|
|
sys.beat(5)
|
|
end,
|
|
|
|
update = function()
|
|
local cam_x, cam_y = -(batman.x-7*8),-(batman.y-6*8)
|
|
if (cam_x>0) then cam_x=0 end
|
|
if (cam_y>0) then cam_y=0 end
|
|
view.origin(cam_x,cam_y)
|
|
|
|
surf.cls(66)
|
|
mapa.draw(1)
|
|
if batman.layer==1 then batman.draw() end
|
|
mapa.draw(2)
|
|
if batman.layer==2 then batman.draw() end
|
|
|
|
if sys.beat() then
|
|
batman.update()
|
|
end
|
|
|
|
--view.origin(0,0)
|
|
--draw.text(tostring(mx//8)..","..tostring(my//8),50,0,22)
|
|
|
|
--text(tostring(editor.current_layer),0,0,22,42)
|
|
end,
|
|
|
|
} |