1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Rep Power

    Question 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
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Rep Power
    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.
  4. #3
  5. Prisoner of the Sun

    Join Date
    Jul 2004
    The Mews At Windsor Heights
    Rep Power
    Here is a good explanation of the theory of scrolling. But it is within the context of tile-based games:


    You really should read all of those tutorials from the start. Someone already gave you this link.
    :: My blip.fm tunes :: Web Design Feeds :: Web Dev Feeds :: CheatSheets :: PHP :: MySQL :: 13 Moon FB App.

    "All matter is merely energy condensed to a slow vibration. We are all one consciousness experiencing itself - subjectively. There is no such thing as death, life is only a dream. We are the imaginations of ourselves."
    - Bill Hicks

    "Truth is hidden in the subtle nature of the heart of everything, although it is invisible. One cannot see it from inside and neither from the surface. One can only live and experience it."
    - Heart Sutra
  6. #4
  7. Periodically energetic Perler
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2005
    Dublin, Ireland
    Rep Power

    maybe have a look at The scrolling game development kit.

    The allegro game programming library also has functions for scrolling the screen.

    The link b3n gave is good as well.

    Vi Veri Veniversum Vivus Vici.

IMN logo majestic logo threadwatch logo seochat tools logo