Helpful Information
 
 
Category: Game Development
Scrolling (in all directions) game

Hi, I'm making a classical RPG. I already have the main screen, the stats, inventory, etc., and the walking hero (but he is walking in the air). Now I need a background, I've been told tile-based backgrounds is the best for huge games. I don't think mine is gonna be that big so I'm planning to do it art-based. But how can I make the screen to follow my hero, for example, if he goes up screen goes up, if he goes right screen goes right. Can anyone tell me how to do this?

Thanks in advance

You have to work with X and Y factors

Every tile has its own coordinates, which you specify in the database. If the house of the hero is:

X 29
y 15

and the hero is at

X 28
Y 15

then he is standing next to the house, Everytime you let your hero walk, it has to update in the database of the player on which coordinates he is at.

I hope you understand what i mean, i have build a similar system, which is very very time-consuming. Considering the time you have to build the game, and how much queries it has to load from the database.

Here is a good explanation of the theory of scrolling. But it is within the context of tile-based games:

http://www.tonypa.pri.ee/tbw/tut13.html

You really should read all of those tutorials from the start. Someone already gave you this link.

Hi,

maybe have a look at The scrolling game development kit (http://gamedev.sourceforge.net/).

The allegro (http://alleg.sourceforge.net/) game programming library also has functions for scrolling the screen.

The link b3n gave is good as well.

Displeaser










privacy (GDPR)