1

Hello
can someone show code to display sprite in a fix layer
code in makefile and main.c
I use ngdevkit
avatar

2

Hi Couzy;

Would love to help, but I still didn't play with the fix layer much. (leaving it for the end, for me fix layer is the hud).
Apart outputting normal text using the ngdevkit.
But looking into the hello world example, there is the steps on how the fix layer is used, also hints from the makefiles.

Might help for other aspects however, game, memory, logic, scrolling etc...

All the best with your work.
avatar

3

thanks a lot for your response
are you on discord, i would like discuss about the good method to make a scrolling please
avatar

4

Hi Couzy;

Yes, my discord is: shadowgangs.
After going through different scrolling implementation, I think I finally got one that works best for me in regards to performance and memory.
Important things are:

1- Has to use the sticky bit, to avoid tearing and slow drawing and updates.
2-Try to exploit the rolling of the sprites at 512 pixels, both in vertical and horizontal scrolls.
3-Hide sprites that are not on screen, as they contribute the max sprites on the same hor lines even if they are out of the display area.
avatar

5

it's exactly what i make
use the sticky bit and the rolling of the sprites at 512 pixels
i change the tiles of the sprites left to update the right of then screen
Which method must i use to hide a sprite ?
avatar

6

Hi Couzy;

I replied on Discord:
For hiding the sprites, I set the vertical size to zero (that's how it is done on the Neo)
Sometimes, only one sprite need it's height to be zero, sometimes two, depending on where the lead sprite are on the rolling 512 pixels
Using Sticky, only one needs to be hidden to hide all others after it.
All others after it will be hidden until hitting the new non sticky sprites.
So I have a list of sticky sprites, with inside one or two that are not.
Total number of sprites per layer is 512 / 16 = 32
in these 32, one or two will be non sticky, one to have the size non zero (lead sprite), and another to have a zero height and hide all sprites after it.
avatar