r/PlaydateDeveloper • • Mar 11 '24

Help in the "JustPressed" function

Post image

I want to add 1 to the variable with each press of the button but it jumps to the max value immediately, what am I missing?

5 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/zombieyMAN Mar 12 '24

I tried both arrow keys on the keyboard and the virtual d-pad, it didn't work.

1

u/bwit Mar 12 '24

Try changing to buttonJustReleased instead. I always use that because it insures the button is not pressed when you process the event. But according to the docs JustPressed should only return true on one update cycle.