Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
98 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Smooth Scrolling
 The Concepts
 Drawing
 Final Thoughts

 Printable version

 


  The Series

 Part 1
 Part 2

 

Final Thoughts

  1. Now that we have a small scrolling tile engine set up, how do I implement it into a game?

    It's relatively simple. To get the world scrolling you'd have to do something like this:

    if (keypress_right) { world_camerax += 8; } if (keypress_up) { world_cameray += 8; }

    Now the player can press a key and have the tiled world scroll. Of course, a lot more goes into the workings of the world/player movement in a game, but I'm sure you can all figure it out : )

    Note: I just made up keypress_right, etc. You'd have to set up DirectInput or use the Win32 API input functions to get player input.

  2. What is that ugly stuff that's happening around the edges of the tiles when I scroll the world?

    That "ugly stuff" is BltFast() not being able to blit objects past the edges of the screen. What you are actually seeing is the drawing of a tile until the top/right/bottom/left of it hits the edge of the screen, and then nothing will be drawn in its place.

    You can fix it by:

    1. Converting all this stuff to use Blt() instead of BltFast().
    2. Doing some fancy calculations with the tile_src RECTs for the appropriate rows or columns.
    3. Cheating and clearing the area around the ugly part with a black section so that it all looks fine and dandy : )

  3. What about all that other stuff like collision detection, multi-layers, etc.?

    I'll really try to get to it. I promise.

  4. "I thought this article was pretty cool!" OR "I hated this @%*^%!$ article!"

    Email me. lpSoftware@gdnmail.net || lpSoftware@home.com

    Visit my website at www.cfxweb.net/lpsoftware

    Also, if you find any mistakes or bugs in this tutorial, please let me know.

This article is © 2000 Martin Estevao. This article may not be re-printed without the author's consent.