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

Drawing and Moving Sprites

When dealing with sprites, the most important commands involve moving and drawing them. Rather than provide separate commands for these functions, DarkBASIC combines the two in a single command called SPRITE. There are SHOW SPRITE, HIDE SPRITE, and several other useful sprite commands that I’ll go over in this section.

Drawing a Sprite

The SPRITE command, which bears mentioning again, draws a sprite using the specified position and image number and stores the settings for that sprite number. The syntax of the command is SPRITE Sprite Number, X, Y, Image Number.

The SPRITE command simultaneously moves and draws a sprite using a specified image number, but once the sprite has been drawn, how do you determine its position? ...

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