Code: Select all
repeat
MouseyX = love.mouse.getX()
MouseyY = love.mouse.getY()
Coord= Coord+1
X1 = X1 + 20 -- Starts as 0 (First tile has X coordinate 20)
X2 = X2 + 20 -- Starts at 20
if MouseyX >= X1 and MouseyX < X2 then -- Checks what column your mouse is in
repeat
Coord = Coord + XTiles -- Checks the tile directly below the last one
Y1 = Y1 +20 -- Starts at 0
Y2 = Y2 +20 -- Starts at 20
if MouseyY >= Y1 and MouseyY < Y2 then -- Checks what row your mouse is in
love.graphics.print("Tile ".."Type"..Tiletype2[Coord], 600,160)
end
until Coord >= TileNum
end
until Coord >= TileNum
X1 = 0
X2 = 20
Y1 = 0
Y2 = 20
Coord = 0