home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / devtools / files / lb202win.exe / LB202W.EXE / SPRGETXY.BAS < prev    next >
Encoding:
BASIC Source File  |  2000-09-21  |  1.0 KB  |  36 lines

  1.  
  2.     'SPRGETXY.BAS  - demonstrate spritexy?
  3.  
  4.     'load the bitmaps we'll use as sprites & background
  5.     loadbmp "smiley1", "sprites\smiley1.bmp"
  6.     loadbmp "smiley2", "sprites\smiley2.bmp"
  7.     loadbmp "smiley3", "sprites\smiley3.bmp"
  8.     loadbmp "smiley4", "sprites\smiley4.bmp"
  9.     loadbmp "landscape", "sprites\bg1.bmp"
  10.  
  11.     'open a window and graphicbox
  12.     WindowHeight = 300
  13.     WindowWidth = 400
  14.     graphicbox #w.g, 0, 0, 400, 300
  15.     open "sprite test" for window_nf as #w
  16.  
  17.     'add a background and sprite
  18.     print #w.g, "background landscape";
  19.     print #w.g, "addsprite smiley smiley1 smiley2 smiley3 smiley4";
  20.  
  21.     'tell the sprite to cycle one frame at a time, and move x5, y5
  22.     print #w.g, "cyclesprite smiley 1"
  23.     print #w.g, "spritemovexy smiley 5 5"
  24.  
  25.  
  26.     for x = 1 to 100
  27.         'draw the next frame of animation
  28.         print #w.g, "drawsprites";
  29.         'get the x and y position of our sprite and print it out
  30.         print #w.g, "spritexy? smiley x$ y$"
  31.         print x$; " "; y$
  32.     next x
  33.  
  34.     input a$ 
  35.  
  36.