[CHG] El contacte en el jefe fa mal

[CHG] La fireball no se pot esquivar apretant avall
[NEW] La fireball se pot para d'una cacauà
This commit is contained in:
2026-05-22 20:46:23 +02:00
parent 4d13ed4eb0
commit 4759767823
5 changed files with 21 additions and 2 deletions
+2 -1
View File
@@ -109,7 +109,8 @@ function fireball.update()
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 and abad.update~=abad_state_crouch then
if fireball.power==1 then
abad_hurt(1)
fireball.hab=-1
elseif fireball.power==2 then
+13
View File
@@ -230,6 +230,19 @@ function world_update()
end
end
end
end
-- Xoc contra la fireball de power = 1
if fireball.power==1 and
viewp:inside(fireball.x, fireball.y, fireball.w, fireball.h)
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
if stage_update then stage_update() end
+1 -1
View File
@@ -268,7 +268,7 @@ if DEBUG_FN_NAME then print("shot") end
flip=true
x_ini = self.x-4
end
local hab, tx, ty, off_x, off_y = coords.world_to_tile(x_ini,self.y+(self.h/4))
local hab, tx, ty, off_x, off_y = coords.world_to_tile(x_ini,self.y+(self.h/2))
fireball.init(hab, tx, ty, flip, off_x, off_y)
sound.play(audio_hit)
+5
View File
@@ -279,6 +279,11 @@ function imp:update_normal()
self:next_frame()
-- colisions en personatges
-- self:colisions()
if viewp:inside(self.x, self.y, self.w, self.h) then
if collision(abad,self) then
abad_hurt(1)
end
end
end
end
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB