I made a little Game Boy!
This is also some sort of controller test, I guess.
⬆️, ⬇️, ⬅️, ➡️, 🅾️ & ❎ are present.
This is charming, SomeGuy™ , however it is possible to push down more than one button at a time so more than one button should appear pressed in this case.
I wrote a full input reader sometime ago.
https://www.lexaloffle.com/bbs/?pid=116361
You are certainly welcome to look it over if you like.
There is a simpler one I wrote HERE:
https://www.lexaloffle.com/bbs/?pid=114374
That's done in only a few lines of code yet reads both player inputs. Player #1 and #2.
. . .
Here is very simple code indeed showing you how to read all the buttons on the regular joystick:
function _update() ?btn() end |
Notice how when you press 2- or more buttons they are added together. Even the "P" is registered as a button and there is a method to disable regular PAUSE so you can use it is a key such as typing "P" .
Also try out the TAB key. Yes there is more than just U D L R O and X read with btn()
Looks better now, @Some Guy™. You see checking multiple buttons gives you better results.
What could you do with 🅾️ held and the UP arrow key held ? The sky is the limit. :)
Best wishes on your coding ...
[Please log in to post a comment]