Hi, everyone. This is the new guy.
I have a question.
I tried to move a Sprite using a keyboard button and then draw it using the draw function.
Finally, my Sprite won't move. I have to keep clicking on the keyboard button to move it.
Why?
A hot potato
Re: A hot potato
Post your code. Also, this belongs to Support & Dev, not General.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: A hot potato
From what I can gather, you put the player's movement code inside of love.keypressed, which is only called when a key is pressed. Instead, put the movement code in love.update, and check if a key is pressed using love.keyboard.isDown.
Re: A hot potato
Can u pls post code here..Bcoz from your question,figuring out information is quite difficult..So pls post your code here,then only users can help DQ Fan Survey
Last edited by Shirley7 on Wed Apr 24, 2019 4:28 am, edited 1 time in total.
Re: A hot potato
Code: Select all
function love.update(dt)
if love.keyboard.isDown("left") then move_left() end
end
Who is online
Users browsing this forum: Bing [Bot] and 7 guests