Search found 5 matches

by Sashz
Thu Sep 28, 2023 10:50 pm
Forum: Support and Development
Topic: isDown, keypressed or wasPressed?
Replies: 9
Views: 7353

Re: isDown, keypressed or wasPressed?

Although no error appears, the scene is not changed. Where is the error? You will need to use both love.update() to process updates and love.draw() to paint updates. Also: love.keypressed.(key) needs to become love.keypressed(key) Use some environment (IDE) that will announce (and fix) such typos a...
by Sashz
Thu Sep 28, 2023 10:23 pm
Forum: Support and Development
Topic: isDown, keypressed or wasPressed?
Replies: 9
Views: 7353

Re: isDown, keypressed or wasPressed?

No error appears? I cant even count all the stuff wrong here. Aside from typos, the main thing is youre calling the tables not the functions. In fact, I had already corrected this error of calling tables instead of functions, but I ended up making the same mistake here on the forum. And I also made...
by Sashz
Thu Sep 28, 2023 9:34 pm
Forum: Support and Development
Topic: isDown, keypressed or wasPressed?
Replies: 9
Views: 7353

Re: isDown, keypressed or wasPressed?

For one time events you only want to react the moment the key is pressed function love.keypressed(k) if k=="right" then next() end end and then have all your scene switch logic in its own function rather than having it scattered around in every scene. In this case we need two additional t...
by Sashz
Thu Sep 28, 2023 7:14 pm
Forum: Support and Development
Topic: isDown, keypressed or wasPressed?
Replies: 9
Views: 7353

Re: isDown, keypressed or wasPressed?

zorg wrote: Thu Sep 28, 2023 6:45 pm Also, there is no such thing as wasPressed.
You are right.
It was Google Bard who suggested I use this...
by Sashz
Thu Sep 28, 2023 4:02 pm
Forum: Support and Development
Topic: isDown, keypressed or wasPressed?
Replies: 9
Views: 7353

isDown, keypressed or wasPressed?

I'm creating a text based game (with images) and I don't really know how to change the scene using the directional keys. When I use isDown, depending on the duration of pressing the key, the game skips the next scene. Example: function update_forest(dt) if love.keyboard.isDown('right') then scene = ...