[WIP] Lluita contra jefes. El cacaus ja li impacten

This commit is contained in:
2026-04-06 02:15:19 +02:00
parent 6ac7a811d9
commit a481d3798b
4 changed files with 12 additions and 4 deletions

View File

@@ -175,7 +175,10 @@ function world_update()
-- 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
-- if collision(actor,cacau_shot) then print("COLLISION") end
-- if actor.enabled then print(actor.name) else print("NOT "..actor.name) end
-- if cacau_shot.alive then print("CACAU") end
if actor.enabled and cacau_shot.alive and collision(actor,cacau_shot) then
if actor.hit ~= nil and not actor.dying then
actor:hit()
if actor.can_warp then warp.open(actor) end

View File

@@ -50,7 +50,7 @@ function imp.new(_hab, _x, _y)
step=0,
hurting=0,
jumpfwd=false,
step_length=1,
step_length=0.6,
vmove_space=1,
max_jump_height=24,
jump_height=0,
@@ -70,6 +70,9 @@ function imp.new(_hab, _x, _y)
super_cooldown=2000,
shot_cooldown=500,
action="",
enabled=true,
disable_reason="",
can_warp=false,
fight=imp.fight,
draw=imp.draw,
hit=imp.hit,
@@ -106,7 +109,7 @@ function imp:draw()
end
function imp:hit()
--
print("HIT!")
end
function imp:direccio( actor )

View File

@@ -132,6 +132,8 @@ function stages.stage1_boss()
-- actors_in_room_backup_and_remove(stage1_boss_mapa.r0.r,stage1_boss_mapa.r1.r)
viewp:fixed({l=8,r=44,u=48,d=0})
stages.boss_loaded = true
boss.reason=""
boss.enabled=true
boss:fight()
end
end

View File

@@ -118,7 +118,7 @@ function zombie:update_hit()
self.frame=self.anim[0]
self.step=0
self.wait=0
self.update=caco.update_normal
self.update=zombie.update_normal
self.dying = false
end
end