Search found 2 matches

by Ulhar
Tue Sep 01, 2020 11:09 pm
Forum: Support and Development
Topic: Waiting for user input?
Replies: 5
Views: 6544

Re: Waiting for user input?

I didn't know that "if var then" would trigger when it is nill, thought it was boolean only. Lua's if statements can accept any value, not just booleans. nil and false are falsy, everything else is truthy. (Also worth noting that the number zero is still truthy, unlike most languages I ca...
by Ulhar
Tue Sep 01, 2020 12:35 am
Forum: Support and Development
Topic: Waiting for user input?
Replies: 5
Views: 6544

Re: Waiting for user input?

I suppose you are going for a turn-based game? If so, I would say don't update the game's current state if a key wasn't just pressed. (Also worth noting: love.keypressed is an event callback. It doesn't return a key that was just pressed, rather it gets called when a key is pressed, passing the key ...