Cacaus volant!

This commit is contained in:
2026-03-23 22:59:50 +01:00
parent cb03264568
commit e28e053cb4
4 changed files with 151 additions and 60 deletions

View File

@@ -13,7 +13,8 @@ function viewport.new()
room=viewport.coord2room,
roomXY= viewport.room2coord,
tile= viewport.coord2tile,
screen_coords = viewport.screen_coords }
screen_coords = viewport.screen_coords,
inside = viewport.inside }
end
function viewport:screen_coords ( x, y )
@@ -22,6 +23,12 @@ function viewport:screen_coords ( x, y )
return scr_x, scr_y
end
function viewport:inside( x, y )
local result = false
if x>=self.x and x<=self.x+self.width and y>=self.y and y<=self.y+self.height then result = true end
return result
end
function viewport:coord2tile ()
local tw = arcade_config.tiles_width
local th = arcade_config.tiles_height