function love.load()
images = {}
for imageIndex, image in ipairs({
1, 2, 3, 4, 5, 6, 7, 8,
'uncovered', 'covered_highlighted', 'covered',
'flower', 'flag', 'question',
}) do
images[image] = love.graphics.newImage('images/'..image..'.png')
end
cellSize = 18
end
function love.update()
selectedX = math.floor(love.mouse.getX() / cellSize) + 1
selectedY = math.floor(love.mouse.getY() / cellSize) + 1
end
function love.draw()
for y = 1, 14 do
for x = 1, 19 do
love.graphics.draw(
images.covered,
(x - 1) * cellSize, (y - 1) * cellSize
)
end
end
love.graphics.setColor(0, 0, 0)
love.graphics.print('selected x: '..selectedX..' selected y: '..selectedY)
love.graphics.setColor(1, 1, 1)
end