diff --git a/data/fireball.lua b/data/fireball.lua index bbdb9cc..2b1eb84 100644 --- a/data/fireball.lua +++ b/data/fireball.lua @@ -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 diff --git a/data/game.lua b/data/game.lua index 8a5a724..42de882 100644 --- a/data/game.lua +++ b/data/game.lua @@ -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 diff --git a/data/imp3-functions.lua b/data/imp3-functions.lua index f9eb7e8..b868f73 100644 --- a/data/imp3-functions.lua +++ b/data/imp3-functions.lua @@ -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) diff --git a/data/imp3.lua b/data/imp3.lua index 8d3811d..1fce3bc 100644 --- a/data/imp3.lua +++ b/data/imp3.lua @@ -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 diff --git a/data/tiles.gif b/data/tiles.gif index 443e379..5a351ca 100644 Binary files a/data/tiles.gif and b/data/tiles.gif differ