From 7faf7049fd58f9066aae2129fc673d4a6aab78cd Mon Sep 17 00:00:00 2001 From: JailGamer Date: Sun, 3 May 2026 00:26:24 +0200 Subject: [PATCH] [NEW] Zombies amb mes d'1 de vida [NEW] Afegits nous 'monstruitos' en la casa de Batman --- data/game.lua | 3 +++ data/stage1.lua | 6 +++++- data/zombie.lua | 47 +++++++++++++++++++++++++++++++++++++---------- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/data/game.lua b/data/game.lua index fd7046e..18fcbc4 100644 --- a/data/game.lua +++ b/data/game.lua @@ -84,6 +84,9 @@ function actor_warp_update(actor) actor.warping = false actor.frame = -1 actor.step = 0 + if actor.energy~=nil then + actor.energy = actor.max_energy + end end end elseif actor.step0 then draw.surf((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end -- if self.frame>0 then draw.surf((self.frame&7)*cw,(self.frame>>cxr2)*ch,cw,ch,self.x*o2aX,self.y*o2aX,cw,ch,self.flip) end + + if self.energy==2 then + pal.subpal(10,14) + elseif self.energy>2 then + pal.subpal(10,9) + end + if self.warping then actor_warp_draw(self) else @@ -46,10 +56,13 @@ function zombie:draw() draw.surf((self.frame&7)*cw, (self.frame>>cxr2)*ch, cw, ch, scr_x, scr_y, cw, ch, self.flip) end end + + pal.subpal(10) end function zombie:update_normal() if not self.enabled then return end + self.wait=self.wait+1 if self.wait==18 then @@ -108,6 +121,13 @@ function zombie:update_hit() if self.can_warp then actor_warp_update(self) else + -- Continuar si encara te vida + if self.energy>0 then + self.update=zombie.update_normal + return + end + + -- Parpadejar if self.step0 then + self.can_warp = false + else + self.can_warp = true + if self.can_warp then self.warping=true end + self.shrink=1 + self.angle=0 + self.dying=true + -- calcular velocitat per al warp + local warp_time = self.death_time/3 + self.d_angle = 720 / warp_time; -- 720 = 2 voltes + self.d_shrink = self.shrink / warp_time + end + self.update=zombie.update_hit end