Code: Select all
--int
function love.load()
home = love.filesystem.getWorkingDirectory()
img = love.graphics.newImage("test.png")
key = ""
imgx = 100
imgy = 100
end
--int END
--main
function love.update(dt)
if love.keyboard.isDown("w") then
imgy = imgy - 1
key = "w"
end
if love.keyboard.isDown("a") then
imgx = imgx - 1
key = "a"
end
if love.keyboard.isDown("s") then
imgy = imgy + 1
key = "s"
end
if love.keyboard.isDown("d") then
imgx = imgx + 1
key = "d"
end
end
function love.mousepressed(x, y, button)
imgx = x
imgy = y
end
function love.draw()
love.graphics.setColor(255,255,255)
love.graphics.draw(img, imgx, imgy, 0, 1, 1, 128, 128)
love.graphics.setColor(255,255,0)
love.graphics.print(key, 300, 300)
love.graphics.print(home, 100, 100)
end
--main end