Mail Archives: djgpp/1998/07/02/16:01:06
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 -