Mail Archives: djgpp/1998/02/18/18:19:33
>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!
The easiest way to do it is to have a virtual screen where you blit the
background graphics. After that you draw the sprites and then blit the virtual
screen to the physical screen. This means you have to re-draw everything on
the screen as soon as something moves, but without sprite-supporting hardware
this seems to be the best way to do it. Check out the example progs in
Allegro(there is one about double buffering and page-flipping) to find out
about how it can be done on the PC.
Christian.
(b.t.w. AMOS-Basic for the Amiga was _really_ cool... I mean programming
smooth games with funky animations, sound & music in an interpreted language
on a computer with less than 10 MHz !!! Those were the days... [sniff] )
- Raw text -