www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/19/12:50:30

From: demandrd AT compusmart DOT ab DOT ca (Demandred)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Using sprites with allegro
Date: Wed, 18 Feb 1998 23:52:27 GMT
Message-ID: <34eb73cb.758518@news.compusmart.ab.ca>
References: <34EADDFF DOT 2718 AT teamw DOT com>
NNTP-Posting-Host: remote613.compusmart.ab.ca
Lines: 28
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Wed, 18 Feb 1998 15:11:27 +0200, Marko Aalto
<marko DOT aalto AT teamw DOT com> was heard to ramble:

>Hi,
>I'm quite new programming in djgpp using allegro, but I have programmed
>in C for years, and back in the old days (= 80's), using basic and
>C64/Amiga, I used to develop games for my own amusement. 
>Because C64/Amiga had sprites, the game programming with them was quite
>easy. Especially, moving sprites across the screen without erasing the
>background was easy.
>But, how do you do the same with allegro? I noticed that it has
>functions for putting sprite (or bitmap) to screen, rotating them etc.,
>but what is the basic principle of moving them without erasing the
>background by using allegro? I guess I should use temporary bitmaps to
>store the background before I blit the sprite to screen or something...
>So, any information regarding this would be appreciated!

One way of doing it (especially if you have a simple background) is to
re-draw the background each frame before blitting the sprites.  If
this is too slow, you could create a bitmap the size of your sprite
and blit the area that the sprite would cover onto this bitmap before
blitting the sprite, then blitting this back to the screen before
drawing the sprite next (assuming the sprite moved).

Did that make any sense?


http://www.nnetis.ca/~matt/dogfight.html

- Raw text -


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