Moguda la comprovació de pintar fora de la funció draw de cada actor
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user