delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/19/16:45:29

From: "J.E." <cellis AT voyageur DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Sprites with Allegro
Date: Fri, 19 Sep 1997 13:26:56 -0500
Organization: Bell Network Solutions
Lines: 22
Message-ID: <3422C3F0.5227@voyageur.ca>
References: <01bcc5e3$05bc3600$423e64c2 AT default>
Reply-To: cellis AT voyageur DOT ca
NNTP-Posting-Host: 207.236.8.3
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Laine wrote:
> 
> Hello
> 
> I'm doing a game with DJGPP and Allegro (actually it's my first PC-game)
> and
> I've got a little problem. How can I move sprites, is there a command in
> Allegro
> to do it?
> And another question: How can I do the double buffering?
> 
Move sprites by erasing the previous sprite and drawing it in a new
location.  Double buffering is simply drawing to a BITMAP buffer the
same size as your screen and then blitting that buffer on to the screen
when you are done drawing.  If you want to use a background with your
sprite, then draw the background before the main loop. Then, in the main
loop, blit a small BITMAP (the same size as your sprite) from where your
sprite is going to be drawn into a temporary buffer. Next, draw your
sprite onto the main buffer and blit the buffer onto the screen.  The
next time through the loop, just put that little BITMAP that you blitted
earlier back to its original location (this will erase the sprite) and
go through the whole process again.

- Raw text -


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