I’m working on the new version of Circuit Dude, which is re-written to include a lot of new levels, features, etc. Needless to say, I’m trying to save as much space as I can while still making the game look better than ever. One of the things that I would like to do is a nice bitmasking tiling solution for the walls in the game.
As you can see, a lot of times, the walls will simply be snaking through the level. (I helped by coloring them green.)
When making bigger sections of walls, it adds to the noise of the level and I think it makes reading levels a little harder. Since I only have a few wall tiles saved as bitmaps. (This is the older version of Circuit Dude for reference.)
What I’m hoping is that the walls can be smushed together like in this mock-up:
This is one of the new additions I’m adding to the PC/mobile/Switch version of Circuit Dude and would like to add it to the Arduboy version.
I’ve come up with a few different solutions, ranging from including a bitmap of each different possible style of wall and selectively drawing the right one (takes up space!) or coming up with an alg to draw them nicely, but it’s so convoluted and possibly slow… I’m wondering what the ‘right’ way to tackle this that would be memory efficient is.
Right now, each level is compressed and then expanded into a 2D array of unsigned char’s when the level is selected, and I already have a function to figure out the surrounding blocks in all 8 directions and even to account for the boundries of the screen (that’s treated like it’s surrounded by more walls).
One of the things making my alg a little ugly is that I’m trying to account for the 1-pixel border that I want to seperate between the wall and the other stuff that could be next to it to give the level a little more readability and breathing room.
This is what the single block would look like as an 8x8 tile in my game where you can see that border. Here are a few more possible combinations of tile blocks, in no particular order, if this helps illustrate what kind f drawing I’m looking for.
Anyway, this community is full of great programmers, like @Pharap, @MLXXXp, etc, etc, so I’m sure this could be a cool discussion as well as a way for me to learn something I never actually got a chance to work with, before.