[WIP] Treballant en el jefe. Barra d'energia

This commit is contained in:
2026-04-11 18:07:43 +02:00
parent 6497f02f3c
commit 2af80b121f
4 changed files with 110 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ require "score"
require "trigger"
require "imp"
require "fireball"
require "bar_meter"
require "stage1"
require "remote_view"
@@ -31,10 +32,18 @@ local view_tile_id = false
local view_checking_tile = false
local stage= 1
local stage_loaded = 0
stage_update = foo
stage_draw_back = foo
stage_draw_middle = foo
stage_draw_front = foo
viewp = viewport.new(arcade_config.resolucion.width, arcade_config.resolucion.height)
viewp:position(0,0)
function foo()
print("foo")
end
function actor_warp_draw(actor)
local shrink_w = actor.w*actor.shrink
local shrink_h = actor.h*actor.shrink
@@ -140,6 +149,10 @@ end
function load_boss_stage()
local stage_boss = stages["stage"..stage.."_boss"]
if stage_boss and not scene_running and not stages.loaded_boss then
stage_update = stages["stage"..stage.."_update"]
stage_draw_back = stages["stage"..stage.."_draw_back"]
stage_draw_middle = stages["stage"..stage.."_draw_middle"]
stage_draw_front = stages["stage"..stage.."_draw_front"]
stage_boss()
print("Stage "..stage.." Boss loaded")
else
@@ -190,9 +203,15 @@ function world_update()
end
end
if stages.boss_loaded then
stage_update()
else
-- print("NO BOSS")
end
-- Actualizar el que queda
cacau.update()
fireball.update()
-- switches.update()
warp.update_all()
end
@@ -200,7 +219,7 @@ end
function world_draw()
-- Pintar la finestra del mon
render_map(sf_mapa, tiles, viewp.x, viewp.y)
if stages.boss_loaded then stage_draw_back() end
-- pintar warps
for key,warp in pairs(warp.warp_list) do
if viewp:inside(warp.x, warp.y, warp.w, warp.h) then
@@ -215,8 +234,10 @@ function world_draw()
end
end
if stages.boss_loaded then stage_draw_middle() end
cacau:draw()
fireball.draw()
if stages.boss_loaded then stage_draw_front() end
remote_view_draw()
end