O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Manipulating Sprites: Rotation and Scaling

DarkBASIC has a fairly good sprite rotation command that rotates a sprite using an algorithm that retains a high level of quality in the resulting sprite image. Most sprite rotation is done in a graphic editor by an artist because this is a time-consuming procedure in the middle of a high-speed game, and also for more obvious quality issues. The last thing you want slowing your game down is a sprite rotation occurring while you are rendering your sprites. However, what about rotating and rendering your sprites at game startup and then using the resulting bitmaps as a sprite array? That way, sprite rotation is provided at runtime, and you only need to draw the first image of a sprite (such as a tank) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required