Liberty BASIC Help Online

Step by Step
 
Here is a step by step review of sprite animation.  See a Simple Demo Program.
 
1.  Open a window containing a graphicbox, or open a graphics window.
 
2.  Load bitmaps for all sprites with the LOADBMP command.  (Sprite bitmaps can also be created at runtime.  For an example, see the Simple Demo Program.)
 
3.  Optional - Load bitmap for background(s) with the LOADBMP command.
 
OR
 
4.  Optional - Load bitmap for background(s) by drawing desired background onscreen and saving it to memory with the GETBMP command.
 
5.  Set the background for animation with the BACKGROUND command.
 
6.  Add all sprites with an ADDSPRITE command for each.
 
7.  For all sprites that are to cycle through frames of animation, issue a CYCLESPRITE command.
 
8.  For all sprites that are to have a size different from the actual bitmap image size, issue a SPRITESCALE command.
 
9.  For all sprites that are to appear in a different orientation, issue SPRITEORIENT commands.
 
10.  For all sprites that are to move automatically with each frame of animation, issue a SPRITEMOVEXY command.
 
DURING ANIMATION:
 
11.  Scroll background, if desired, with the BACKGROUNDXY command.
 
12.  Move sprites individually, if desired with the SPRITEXY command.
 
13.  Change scale, cycling, orientation and visibilty of sprites as required by the specifics of the program with SPRITESCALE, SPRITEORIENT SPRITEVISIBLE, SPRITECYCLE.
 
14.  Obtain current location of desired sprites with the SPRITEXY? command.
 
15.  Retrieve lists of sprites that have collided with designated sprites with the SPRITECOLLIDES command.
 
16.  Place frames of animation on the screen with the DRAWSPRITES command.


Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/