diff --git a/caco.lua b/caco.lua index 16c363e..22e8618 100644 --- a/caco.lua +++ b/caco.lua @@ -1,11 +1,11 @@ caco={} function caco.new(_hab,_x,_y,_flip) - return {hab=_hab,x=_x,y=_y,flip=_flip,frame=19,wait=0,step=0,hit=caco.hit,update=caco.update_normal,draw=caco.draw,jumpfwd=false,anim={19,19,20,21},bb={x=2,y=0,w=12,h=16}} + return {hab=_hab,x=_x,y=_y,flip=_flip,frame=19,wait=0,step=0,hit=caco.hit,update=caco.update_normal,draw=caco.draw,jumpfwd=false,anim={19,19,20,21},bb={x=2,y=4,w=12,h=8}} end function caco:draw() - sspr((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) + if self.frame>0 then sspr((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end end function caco:update_normal() @@ -63,7 +63,7 @@ function caco:update_hit() if self.step%2==0 then self.frame=21 else - self.frame=7 + self.frame=-1 end elseif self.step>=40 then self.frame=19 diff --git a/zombie.lua b/zombie.lua index f852901..eee5cb3 100644 --- a/zombie.lua +++ b/zombie.lua @@ -5,7 +5,7 @@ function zombie.new(_hab,_x,_y,_flip) end function zombie:draw() - sspr((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) + if self.frame>0 then sspr((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end end function zombie:update_normal() @@ -56,7 +56,7 @@ function zombie:update_hit() if self.step%2==0 then self.frame=16 else - self.frame=7 + self.frame=-1 end elseif self.step>=40 then self.step=0