Mail Archives: djgpp/1998/01/04/22:34:43
Robert Clayton wrote:
>
> Okay, my problem is this-
> I can make some sprites dance around the screen, and I have a little
> space ship that the player controls. That's all fine and dandy, the
> problem is that I can't get it to run fast enough. I can smoothly
> scroll the ships, etc. I don't know why.
> It's not my machine, a P166. I'm using Allegro, drawing the sprites
> onto a bitmap which I then show, using the double buffering technique.
> Any help?
There are several possible causes: Video mode and resolution, the types
and sizes of the images you're using, frame-rate control through the use
of a timer, inefficient algorithm, programming errors, your perception
of what "fast enough" means, etc.
In the Asteroids-type game I'm writing using 640x480x256 on a Pentium
120 with a Path 411 Trio 64 (S3 based), with lots of RLE objects and
four rotating bitmap images floating around the screen, I get about 30
frames per second which is an ideal speed for this particular game. The
only way I can really help is to look at your source code. Allegro has
good facilities for fast animation; it's just a matter of how you use
them and how fast is fast enough.
Bitmap formatted images take the longest to blit to the screen, so
should be used minimally at run-time. RLE and compiled sprites are the
fastest but least flexible, but you can work around their limitations.
One technique I use with frequently used bitmaps that need fine
rotations is to convert them to arrays of compiled sprites when the
program first starts. It's memory-intensive, but the speed increase is
enormous.
Feel free to e-mail me if you want to discuss details.
--
Tony O'Bryan
http://www.geocities.com/SiliconValley/Park/7201
- Raw text -