delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/23/19:01:01

From: punjab AT ix DOT netcom DOT com (//)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: sprites and ALLEGRO'S draw_sprite();
Date: 23 Jan 1998 22:46:29 GMT
Organization: Netcom
Lines: 23
Message-ID: <6ab6k5$69g@sjx-ixn4.ix.netcom.com>
References: <19980123161800 DOT LAA01145 AT ladder01 DOT news DOT aol DOT com>
NNTP-Posting-Host: stk-ca1-22.ix.netcom.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In <19980123161800 DOT LAA01145 AT ladder01 DOT news DOT aol DOT com> pitel AT aol DOT com
(Pitel) writes: 
>
>Hello 
>
>Can someone help me, i am trying to display
>a sprite animation on a screen that i have place 
>a background bitmap image, but as i move the sprite
>the sprite destroyes the background (erases it).
>
>how can i save the background image and restore it 
>when the sprite has moved off that area.
>
>Thanks 
>
>Pitel AT aol DOT com
>Eric  

Use a Z-buffer algorithm as it alows you to consider depth and will
write pixels that are nearest to you--not in the background.  The
Z-buffer contains the image at a specific frame corresponding to the
displayed images z coord during that frame (search the web for a more
robust description).  Hope that helps.

- Raw text -


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