New games every week!
Waste of a Day Blog
1st August 2022
Feels a lot like spending a day drawing a rainbow!


As I continue to plan a new JNKPlat for SmileBASIC, I am at least planning a little further, and considering how to do a new edition online.
I'd probably have to force a keyboard layout for this one. Whereas most games happily use whatever buttons you'd like (WASD+JKLI/Cursors+ZXCV), the whole Two-Button-Jump just doesn't work in those layouts.
And touchscreen's well out of the question.

I've had this issue MANY times before!!

I'm not worrying about that yet, though. The first issue is how to create levels that'll work in both versions.
It's REALLY hard to get things from PC to SmileBASIC, (unless you code a tool to transfer data across using an Arduino) so I'm instead thinking that if I build a sturdy editor on the Switch, then I can cross those over to the PC in a vaguely decent manner.

"Why don't you generate a QRCode? Then you can access those on the PC side, and extract the data!!"
What a wonderful idea, Jay!

So I spent the next few hours trying to figure out how to generate a QR Code.
I opened up a bunch of different QRCode Sourcecode projects from GitHub, and ...
Good grief!!

I got nowhere.

So instead I started doing some maths, and logically I should be able to fit the entire level into a 32x32 image, though it'll have to be resized a bit to avoid screenshot based issues.

I have to be sure to avoid jpeg artifact issues, so all the colours need to be reduced down so that they average out when accessed on the PC. I'll also have to work in chunky 4x4 pixel .. pixels.. So that again, it averages well. Edges are messy in jpegs!

Red and Green channels to hold tile data, and the Blue channel to do any other data I need to send.
Tiles are numbered 0-62, which cuts evenly to 0-31 twice.. Multiply by 8, and you can store those as red and green values in the colours of an image.

Scale everything up to 4x4 blocks, and render it out. This can then be grabbed as a screenshot and .. hopefully when I take it over to the PC, it should be easy enough to extract the data back out.

Tests will, of course, be needed, but I *think* it should work reasonably well enough.

.. Gotta build the level editor first, though!
Views 16, Upvotes 2  
Daily Blog , Planning
New games every week!
Site credits : This was all done by Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed

Blog - Waste of a Day - AGameAWeek