Various button pressing functions don't seem to do anything?
Posted: Mon Aug 11, 2014 8:32 pm
So, I've just been messing around with it, not necessarily trying to make a game or anything, but I've been trying to have the program show a picture when I press spacebar.
I have also tried doing this with a function, but that wasn't working either. What happens, in effect, is I run it, it displays backgrounds, no errors, but nothing seems to happen when I press spacebar.
Code: Select all
function love.load()
love.graphics.setBackgroundColor(255,0,0)
<what I named the picture> = love.graphics.newImage("<the name of the picture>")
end
function love.draw()
if love.keyboard.isDown("spacebar") then
love.graphics.draw(<what I named the picture>, 300, 400)
end
end
Code: Select all
love.keypressed(key)