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
gps_gif_col = 7
gps_gif_row = 3
gps={hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
gps={name="gps",hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
function gps.init()
local habs={{33,8},{13,4},{51,9},{50,4},{42,7}}
@@ -32,10 +32,8 @@ function gps.draw()
local x = gps_gif_col*cw
local y = gps_gif_row*ch
if viewp:inside(gps.x, gps.y, gps.w, gps.h) then
local scr_x, scr_y = viewp:screen_coords( gps.x, gps.y )
draw.surf(x,y,gps.w,gps.h,scr_x,scr_y,gps.w,gps.h)
end
local scr_x, scr_y = viewp:screen_coords( gps.x, gps.y )
draw.surf(x,y,gps.w,gps.h,scr_x,scr_y,gps.w,gps.h)
end
function gps.update()