delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/02/16:01:06

From: sparhawk AT eunet DOT at (Gerhard Gruber)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: scrolling with allegro
Date: Thu, 02 Jul 1998 19:57:16 GMT
Organization: Customer of EUnet Austria
Lines: 33
Message-ID: <35a2e00a.1847067@news.Austria.EU.net>
References: <001a01bda51b$07837e40$624d08c3 AT arthur> <oB2SXCA7Fqm1MwIk AT fluidcontrol DOT demon DOT co DOT uk>
NNTP-Posting-Host: e103.dynamic.vienna.at.eu.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Destination: Kevin Smith <Kevin AT fluidcontrol DOT demon DOT co DOT uk>
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: Wed, 1 Jul 1998 21:52:11 +0100:

>>Use the tile method. Get a load of sprites which define the landscape (you
>>can use the same sprite on many different parts of the landscape). Define an
>>array for your map. If your tiles are 32x32 pixels in size, and you have a
>>maximum of 255 tiles, then your array needs to be 50x50 bytes in size for a
>>1600x1600 pixel map (1600/32=50). Now all you need to do is see what sprites
>>defined in this array need to de drawn, and draw them on the screen in the
>>right place.
>>
>>James Arthur
>>jaa AT arfa DOT clara DOT net
>>
>thats a lot of things to keep track of!
>is there any examples i could have a look at that use this method?

Why? You need to know which portion of the field you have to display on the
screen anyway. So instead of directly displaying it you keep track of it in an
array that holds the definition of the landscape. The you iterate through this
array and look what type of tile you need for the segment in the landscape you
are about to display.

--
Bye,
   Gerhard

email: sparhawk AT eunet DOT at
       g DOT gruber AT sis DOT co DOT at

Spelling corrections are appreciated.

- Raw text -


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