[CHG] Canviada una expressió de l'abad

[FIX] Corregida col·lisió en la fireball
[CHG] Mogut debug a game_debug
[NEW] Stage manager per a gestió de nivells
This commit is contained in:
2026-05-24 18:47:04 +02:00
parent 9f97bf9160
commit 84124d7f7b
9 changed files with 277 additions and 365 deletions
+39 -28
View File
@@ -42,6 +42,8 @@ function fireball.draw()
end
function fireball.update()
if fireball.hab == -1 then return end
if fireball.power==2 and fireball.power>fireball.size then
fireball.wait = fireball.wait + 1
fireball.x1=abad.x+abad.bb.x+(abad.bb.w//2)
@@ -78,10 +80,8 @@ function fireball.update()
fireball.h=fireball.w
fireball.bb = {x=0,y=0,w=4*fireball.size,h=4*fireball.size}
return
end
end
if fireball.hab == -1 then return end
-- fireball.wait=fireball.wait+1
--if fireball.wait==3 then
@@ -91,35 +91,46 @@ function fireball.update()
-- fireball.hab=-1
-- return
--end
if fireball.power==1 then
if arc_check_tile(fireball.x,fireball.y)<tiletype.block then
if fireball.flip then
fireball.x=fireball.x-fireball.step_length
else
fireball.x=fireball.x+fireball.step_length
end
if fireball.power==1 then
if arc_check_tile(fireball.x,fireball.y)<tiletype.block then
if fireball.flip then
fireball.x=fireball.x-fireball.step_length
else
fireball.hab=-1
return
end
elseif fireball.power==2 then
fireball.x = fireball.x+fireball.step_length_x
fireball.y = fireball.y+fireball.step_length_y
end
if viewp:inside(fireball.x, fireball.y, fireball.w, fireball.h) then
if collision(fireball,abad) then
-- if fireball.power==1 and abad.update~=abad_state_crouch then
if fireball.power==1 then
abad_hurt(1)
fireball.hab=-1
elseif fireball.power==2 then
abad_hurt(2)
fireball.hab=-1
end
fireball.x=fireball.x+fireball.step_length
end
else
fireball.hab=-1
return
end
elseif fireball.power==2 then
fireball.x = fireball.x+fireball.step_length_x
fireball.y = fireball.y+fireball.step_length_y
end
if viewp:inside(fireball.x, fireball.y, fireball.w, fireball.h) then
if collision(fireball,abad) then
-- if fireball.power==1 and abad.update~=abad_state_crouch then
if fireball.power==1 then
abad_hurt(1)
fireball.hab=-1
elseif fireball.power==2 then
abad_hurt(2)
fireball.hab=-1
end
else
if fireball.power==1 then
for _, cacau_shot in pairs(cacau.shots()) do
if cacau_shot.alive and
collision(fireball,cacau_shot)
then
fireball.hab = -1
cacau:kill(cacau_shot)
end
end
end
end
else
fireball.hab=-1
end
--end
end