Moguda la comprovació de pintar fora de la funció draw de cada actor

This commit is contained in:
2026-03-29 17:02:05 +02:00
parent 2c93003fe2
commit 7f4f29ecc2
12 changed files with 44 additions and 53 deletions

View File

@@ -15,7 +15,8 @@ function gota.new(_hab,_x,_y,_freq,_x_offset, _y_offset)
_y_offset = _y_offset or 0
world_x = world_x+_x_offset
world_y = world_y+_y_offset
return {hab=_hab,
return {name="gota",
hab=_hab,
ix=world_x,
iy=world_y,
x=world_x,
@@ -39,13 +40,11 @@ end
function gota:draw_normal()
local x = gota_gif_col*cw
local y = gota_gif_row*ch
if viewp:inside(self.x, self.y, self.w, self.h) then
local scr_x, scr_y = viewp:screen_coords( self.x, self.y )
draw.surf(x,y,self.w,self.h,scr_x,scr_y)
-- local x_check = scr_x+self.bb.x+(self.bb.w/2)-1
-- local y_check = scr_y+self.bb.h
-- draw.rectf(x_check,y_check,1,1,4)
end
local scr_x, scr_y = viewp:screen_coords( self.x, self.y )
draw.surf(x,y,self.w,self.h,scr_x,scr_y)
-- local x_check = scr_x+self.bb.x+(self.bb.w/2)-1
-- local y_check = scr_y+self.bb.h
-- draw.rectf(x_check,y_check,1,1,4)
end
function gota:update_normal()