Is there a mistake ? since doesn't need the keyinput functions above the update function ?
Code: Select all
function love.load()
love.graphics.setFont(12)
text = "Nothing yet"
end
function love.update(dt)
if love.keyboard.isDown( " " ) then
text = "The SPACE key is held down!"
end
end
function love.draw()
love.graphics.print( text, 330, 300 )
end
function love.keypressed( key )
if key == "return" then
text = "RETURN is being pressed!"
end
end
function love.keyreleased( key )
if key == "return" then
text = "RETURN has been released!"
end
end
You can find the complete list of keys here. The best place to perform this check is inside the love.update callback: that way we're able to get input from the user and update our variables before drawing our stuff into the screen. So, our modified love.update callback should look like this:
Code: Select all
flove.keyboard.isDown()
end
thanks for all who help me.
best regards
Lovingsoul1337