delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/20/06:10:42

From: Ian Dunbar <ian_dunbar AT my-dejanews DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Tile-based side scroller
Date: Tue, 20 Apr 1999 10:30:16 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 37
Message-ID: <7fhkvo$9sa$1@nnrp1.dejanews.com>
References: <371BA144 DOT 7E87BF51 AT usa DOT net>
NNTP-Posting-Host: 193.120.210.2
X-Article-Creation-Date: Tue Apr 20 10:30:16 1999 GMT
X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I)
X-Http-Proxy: 1.0 ns.euristix.ie:80 (Squid/1.NOVM.20), 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client unknown, 193.120.210.2
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <371BA144 DOT 7E87BF51 AT usa DOT net>,
  "Lonny Smith" <VegetaSSJ AT usa DOT net> wrote:
> I'm doing a side scroller and I was wondering exactly how to get the
> screen to scroll.  And am I supposed to use an enourmous image as the
> level or what?  Are there utilities for making scrollers?  I'm
> completely clueless.  Any help would be appreciated.
>

Well it kind of depends on what you want the background to be made up of. I
have a multi directional scroller, and it is made up of bitmaps. The screen
shows 10x10 BITMAPs at a time, and then define a map to be a 100x100 (or
something) array of BITMAP pointers. The current location is stored relative
to the map, so based on the location I decide which 10x10 bitmaps to draw. I
blit them onto a memory bitmap, and then blit that onto the screen.

The code for my "game" is at:
http://www.geocities.com/SiliconValley/Lab/5437/scroller.zip

tilegame.cpp is the file most of the stuff is in.

It is nowhere near complete, but you should be able to see how I do the
scrolling.

If you are doing a defender type game you probably just need to have an array
containing the heights of the landscape, rather than tiles for each area of
the screen.

There are probably some better demos & information at:
ftp://x2ftp.oulu.fi/pub/msdos/programming/

Hope that helps,
Ian.
--
ian_dunbar AT my-dejanews DOT com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019