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
|
||||
peu_gif_col = 7
|
||||
peu_gif_row = 2
|
||||
|
||||
peu={hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
|
||||
peu={name="peu",hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
|
||||
|
||||
function peu.init()
|
||||
local habs={{18,8},{16,2},{16,7},{15,5},{27,1},{27,10},{29,2},{38,8},{69,2},{79,3}}
|
||||
@@ -32,10 +32,8 @@ function peu.draw()
|
||||
|
||||
local x = peu_gif_col*cw
|
||||
local y = peu_gif_row*ch
|
||||
if viewp:inside(peu.x, peu.y, peu.w, peu.h) then
|
||||
local scr_x, scr_y = viewp:screen_coords( peu.x, peu.y )
|
||||
draw.surf(x,y,peu.w,peu.h,scr_x,scr_y,peu.w,peu.h)
|
||||
end
|
||||
local scr_x, scr_y = viewp:screen_coords( peu.x, peu.y )
|
||||
draw.surf(x,y,peu.w,peu.h,scr_x,scr_y,peu.w,peu.h)
|
||||
end
|
||||
|
||||
function peu.update()
|
||||
|
||||
Reference in New Issue
Block a user