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

@@ -7,7 +7,7 @@ ch = arcade_config.character_height
gorro_gif_col = 6
gorro_gif_row = 2
gorro={hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
gorro={name="gorro",hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
function gorro.init()
local habs={{60,5},{4,5},{34,4},{62,7},{75,4}}
@@ -31,10 +31,8 @@ function gorro.draw()
local x = gorro_gif_col*cw
local y = gorro_gif_row*ch
if viewp:inside(gorro.x, gorro.y, gorro.w, gorro.h) then
local scr_x, scr_y = viewp:screen_coords( gorro.x, gorro.y )
draw.surf(x,y,gorro.w,gorro.h,scr_x,scr_y,gorro.w,gorro.h)
end
local scr_x, scr_y = viewp:screen_coords( gorro.x, gorro.y )
draw.surf(x,y,gorro.w,gorro.h,scr_x,scr_y,gorro.w,gorro.h)
end
function gorro.update()