New games every week!
1st May 2021
As I wrote the Gamepad code for JSE yesterday, I realised just how much better it is than the current Browsercade code.
One of the reasons Browsercade is so limited is because it has to include support for touchscreens. Limiting the onscreen button layout so it doesn't end up like.. well, this..
Which, I think we can all agree, is a step too far.
As such, I coded the browsercade's functionality so that most things require only four directions and a couple of face buttons.
The right thumbstick is ignored, and a few game ideas went the way of the dodo as a result.
Yesterday, however, I sat and mostly rewrote the controller code for JSE from scratch.
The new JSE Controller code supports 4 ports (0 to 3) as well as a 5th (port 4!) Keyboard Only port.
The default Port -1 is a set of combined values for all of the ports, meaning if you're making a generic single player thing, you can simply use the commands without a port number, and anything should work.
In addition, both thumbsticks now work properly, too.
There's a combined set of basic up/down/left/right values which add together the DPad and the left thumbstick. There are also separate values for DPad and Left thumbstick.
There's an additional set of values for the Right thumbstick.
Then there are the four face buttons, Start and Select, L1/L2/R1/R2 triggers, and even L3 and R3 for when the thumbsticks are clicked.
Times 4 ports + Keyboard + a combined default port with everything all together.
The one thing that doesn't work, however, is onscreen touch.
Today I guess I'll have to tackle that. I'm currently wondering whether I should add a little toggle on the top of the editor's GUI to let the "player" switch on the onscreen controls, rather than attempt to do it intuitively. ... Which has been another of Browsercade's failings!!
Once it's all working well enough in JSE, I'll probably have a play with porting it all over to Browsercade, since it's much more capable. The main issue, however, is ensuring it doesn't break any of the game code that's already in there. The last thing I want is to have to go back and fix all of the browsercade games!!
But, first, figuring out the touchscreen controls, and no doubt making a right mess of it all!
New games every week!