How To

How do I make an rpg scrolling overworld?

0

Jovanihere44 2020-12-07 21:12

This is for my game "The Sword Of Justice". I need help with the stuff I need to begin with.


Timo 2020-12-07 21:42

To keep it simple I would switch screens (similar to the old Zelda) instead of real scrolling.
So when the sprite reaches one border of the screen you change the offset in BG COPY. (Sorry, I’m too tired for details now)


was8bit 2020-12-07 22:08

Scrolling can look really great, but very tricky...

The visualy seen space on the screen is 20x16 cells, or 160x128 pixels... however a background actually holds 32x32 cells, or 256x256 pixels, so one trick is to remove old content from one side off sight and add new content to the other side off sight, and perform a scroll.... the actual code depends on your specific approach...

Also to rememer is that SCROLL only applies to backgrounds, and not to sprites... also to remember is that SCROLL is only a visual "trick" it doesnt actually move the cells, so CELL 1,1 remains CELL 1,1 even though visually is appears to move, so if you scroll alot , the space on your screen that "used" to be 1,1 now may be showing CELL 8,1.. so SCROLL moves the coordinate system, which can be confusing...

BG SCROLL actually moves cell contents, but it is NOT smooth, and uses alot of your CPU


was8bit 2020-12-07 22:12

The easy approach is to limit movement to cell blocks that "jump" into their new place by using BG COPY to replace the actuall bg cells... this keeps everything lined up as expected... but it isnt smooth...

Another approach is to add a line of cells just off screen and scroll 8 pixels for a smooth look, and THEN do a quick simultameous scroll reset to 0,0 and a BG COPY to update the cells so everything still lines up...


was8bit 2020-12-07 22:13

I would also recommend looking at Timo's code here...

https://lowresnx.inutilis.com/topic.php?id=318

This should really help :)


was8bit 2020-12-08 02:34 (Edited)

If you want to try page changes, it may be the easiest method... i do that with my game here...

https://lowresnx.inutilis.com/topic.php?id=1581

I use backgrounds and sprites together... the background changes as my player walks off the left or right edge...


Log in to reply.