Log In  

Cart #gameboy-2 | 2023-01-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I made a little Game Boy!
This is also some sort of controller test, I guess.

⬆️, ⬇️, ⬅️, ➡️, 🅾️ & ❎ are present.

P#123641 2023-01-04 08:55 ( Edited 2023-01-25 15:42)


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.


You are certainly welcome to look it over if you like.

There is a simpler one I wrote HERE:


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()

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()

P#123658 2023-01-04 17:38 ( Edited 2023-01-04 18:43)

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 ...

P#123795 2023-01-06 02:14

[Please log in to post a comment]