- Working on intro and menu

This commit is contained in:
2022-12-28 14:06:26 +01:00
parent 02ad5addad
commit 1d2e65d93f
5 changed files with 134 additions and 9 deletions

View File

@@ -18,7 +18,7 @@ function remove_actor(actor)
end
end
function game_init()
function game_init(menu)
actors={}
cameras={}
camera_names={[0]="GPS","Gorro","Peu de Paco","Premiere","EL_ALIEN","BatMan"}
@@ -89,7 +89,7 @@ function game_init()
table.insert(actors,caco.new(17,24,16,false))
-- TRIGGERS
table.insert(actors,trigger.new(10,44,32,triggers.escena_abad_inici))
if not menu then table.insert(actors,trigger.new(10,44,32,triggers.escena_abad_inici)) end
table.insert(actors,trigger.new(11,16,32,triggers.escena_abad_corfes))
table.insert(actors,trigger.new(19,32,32,triggers.escena_habitacio_batman))
score.create()
@@ -101,7 +101,11 @@ function game_init()
table.insert(cameras,elalien)
table.insert(cameras,batman)
_update=update_game
if menu then
_update=update_menu
else
_update=update_game
end
end
function text(str,x,y,col)
@@ -282,6 +286,25 @@ function update_game()
end
end
function update_menu()
cls(16)
text("C A C A U S", 40, 14, 15)
rect(15,44,113,93,2)
draw_hab(cameras[current_camera].hab,16,45)
mapa_update(abad.hab,cameras[current_camera].hab)
for key,actor in pairs(actors) do
actor:update()
end
imp.update()
bambolla.update()
cacau.update()
fireball.update()
switches.update()
end
function game_exit()
mapa_restore_backup()
--freesurf(tiles)