El monstruitos ja fan pupa

This commit is contained in:
2026-03-29 19:32:13 +02:00
parent fa74a841e7
commit 8d84cdbda1
5 changed files with 30 additions and 9 deletions

View File

@@ -175,16 +175,11 @@ function update_game()
arc_mapa_update()
-- Moure a tots
for key,actor in pairs(actors) do
actor:update()
--if actor.hab==cacau.hab and actor~=abad then
-- if aabb(actor,cacau) then
-- if actor.hit~=nil then
-- actor:hit()
-- cacau.hab=-1
-- end
-- end
--end
-- Comprovar dispars contra "monstres"
if viewp:inside(actor.x, actor.y, actor.w, actor.h) and actor~=abad then
for _, cacau_shot in pairs(cacau.shots()) do
if cacau_shot.alive and collision(actor,cacau_shot) then
@@ -200,6 +195,7 @@ function update_game()
cacau.update()
switches.update()
-- Moure el viewport
local vp_x = viewp.x
local vp_y = viewp.y
--viewp:position(vp_x, vp_y)
@@ -214,6 +210,8 @@ function update_game()
if vp_y < 0 then vp_y = 0 end
viewp:position(vp_x, vp_y)
-- Pintar la finestra del mon
render_map(sf_mapa, tiles, vp_x, vp_y)
for key,actor in pairs(actors) do