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?



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.


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


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.


1

Probably related to this if you're using 0.1.0e

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



[Please log in to post a comment]