How To

How to BG COPY a bigger background than 32*32 ?


G-9 2020-10-24 13:24

I want to do :
BG COPY 0,0,128,16 TO 0,0

If we cant please give me alternatives :)

P.S: i want to use it with SCROLL b,x,y

was8bit 2020-10-24 15:21

The Background Designer can create many different sizes...

However, the actual size of the visible screen view is 20x16, and the actual size of then working backgrounds (0 and 1) are 32x32

If you have designed a background bigger than 32x32, and want a game to scroll with your bigger designed background, i recommend this...

BG COPY SX,SY,20,16 TO 0,0

Where SX,SY is the top coordinate of what you to copy from your designed background...

was8bit 2020-10-24 15:23 (Edited)

Rather than using SCROLL, you simply recopy new background manually...

However, with this method you cannot scroll off the edge and wrap around as BG COPY does not properly wrap around...

was8bit 2020-10-24 15:43

Check this out....

BGCOPY TEST.nx | Open in app
2020-10-24 15:43

was8bit 2020-10-24 15:44

... let me know if you want to wrap around....

Timo 2020-10-24 17:04

I’ll make an example later today.

G-9 2020-10-24 17:10

I tried this but ... i need smoother like SCROLL . My game(s) is a platformer, I can’t make the player move 8 pixels at once...

Timo 2020-10-24 18:18 (Edited)

Actually I already have an example:

But it's optimized for less CPU use and a bit more complicated. I will make a simpler example, too.

Timo 2020-10-24 18:32

Here is the simplified example. It has no collision checks and you cannot collect items. Also it's not that optimized for CPU, but it runs still with only 5% CPU load, so it's ok.

The trick is, that you use the SCROLL command and at the same time you draw the map with BG COPY. All the co-ordinates wrap around the edges, so you don't see the 32x32 limit.

Timo 2020-10-24 18:42 (Edited)

Check out this video about the Game Boy:

LowRes NX has the same system for scrolling! The important part starts at 4:15

was8bit 2020-10-25 04:04 (Edited)

Yes, anything Timo posts will work properly :)

... I always go to his code when I get stuck ;)

G-9 2020-10-25 14:07

:) thanks :)

G-9 2020-10-25 14:13


Log in to reply.