LynxJam2023 - day 5


Code is in progress : the game engine should be finished in 2 or 3 days.
It's a very basic engine but since it's a time limited jam, I took the SCRUM approach  : deliver a working product every week.
Then week after week, I'll update as much as possible until the final date.

With this approach , you could theorically deliver Space Invader at the end of first week, and Ikaruga weeeeks later.

But the more important : whatever happen, you have a working game to submit.
Nothing is more frustating that to spend weeks on a game to finally submit nothing (playable). 


On the tech side, I had to make some UI and, like I said, I'm on a very basic one.
2 options: use UI graphics or use basic scaled squares ;)

Of course, I went for the 2nd one for now.
But how you do this ?

First you need a pixel to play with.
You could create a 1x1 bitmap and use sprpck to convert to a 1bpp sprite.
But something so simple, you could create it by code directly.

First the sprite data

const unsigned char pixel[4] = {
3,           //offset to next line
0b10000000,  //1 --> literal
             //0000 --> number of pixels - 1 (so here we have a 1 pixel line)
             //0 --> color index of pixel 0
             //00 -> fill bits
0, //space to use an even number of bytes
0 // end of sprite };

(comments should be enough for you to understand)

So we have a 1x1 pixel using pal index 0.
What can we do with this ?
Draw a rectangle of any size and any color we want.

How to do that ?

SCB_REHV_PAL uiRect = {
BPP_1| TYPE_BACKGROUND,
REHV,
0x01,
0,                    //end of sprite list
pixel,                //our sprite data
<xPos> , <yPos>,
<hSize<<8> , <vSize<<8>,  
{0xEF}                //affect color index 0 to pen 0xE };

TYPE_BACKGROUND is important if you used color index 0, else it will be a transparent rect whatever you do.
with hSize and vSize, you can scale your 1x1 pixel up to 255x255 with any variation between
with pens, you could set use pixel color index as a pen id, and so use the pal index you want

In fact, you could also draw a triangle using 1x1 pixel and Scale+Stretch but I'm not used to it yet...perhaps later when I'll need particles for example.

Get Hero Dust

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.