Log In  

So I know the documentation is a bit spotty at the moment but I was curious if the btn() function is the same as in P8?
I set up a simple sprite to move around and used the usual btn() setup for up down left and right but am getting weird behavior. Sometimes when I press left or right it will go up, or go diagonally randomly.
Sometimes it will work perfectly normal.

Anyone else experience this?

P#145262 2024-03-31 16:41 ( Edited 2024-03-31 16:45)

btn() returns a combination of the buttons pressed as a number (I think). You can use key() and keyp() however, and they work fine e.g. key("x") will be true if x is held down, key("right") detects the right arrow, and so on.

P#145265 2024-03-31 17:07 ( Edited 2024-03-31 17:08)

Yeah I had the same problem last night, Still didnt find a solution today, so thanks @Soupster! thats very helpful

P#145279 2024-03-31 19:30

I've encountered this bug before; sometimes the D-pad/arrow keys will be just a little bit off and claim there is a slight diagonal. I think it has to do with some kind of automatic calibration going awry because I can make it manifest if I use the arrow keys at the same time as I wiggle the control stick on my gamepad, and if I just play with the control stick without touching the arrow keys it can fix itself.

P#145284 2024-03-31 20:30
1

Probably related to this if you're using 0.1.0e

https://twitter.com/lexaloffle/status/1774228782511177838

P#145291 2024-03-31 21:40

[Please log in to post a comment]