home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / sprite / exam08.dba < prev    next >
Encoding:
Text File  |  2000-04-09  |  1.3 KB  |  60 lines

  1. Rem * Title  : Flipping a Sprite
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ===================================================
  5. rem DARK BASIC EXAMPLE PROGRAM 8
  6. rem ===================================================
  7. rem This program will draw and flip a sprite on screen 
  8. rem ---------------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),1
  12.  
  13. rem Load a bitmap on to the screen
  14. load bitmap "face.bmp"
  15.  
  16. rem Grab image 1 from bitmap
  17. get image 1,18,17,156,196
  18.  
  19. rem Clear the Screen
  20. cls
  21.  
  22. rem Now we will make a sprite
  23. sprite 1,100,100,1
  24.  
  25. rem get sprite width and find the middle of it going across
  26. rem get sprite height and find the middle of it going down
  27. rem new offset for sprite 1 
  28.  
  29. offset sprite 1,(sprite width(1)/2),(sprite height(1)/2)
  30.  
  31. rem the is were on screen sprite will appear
  32. acrossscreen=(640/2)
  33. downscreen=(480/2)
  34.  
  35. rem press left mouse button to quit
  36. rem move mouse left,right,up and down to stretch sprite
  37.  
  38. print "the flip sprite command"
  39. repeat
  40.  
  41.     rem flip sprite
  42.     flip sprite 1
  43.  
  44.     rem draw the sprite at the new position
  45.     sprite 1,acrossscreen,downscreen,1
  46.  
  47. until mouseclick()=1
  48.  
  49. rem clear the screen
  50. cls 
  51.  
  52. rem remove the sprite from memory
  53. delete sprite 1
  54.  
  55. rem remove image 1 from memory
  56. delete image 1
  57.  
  58. rem End the program
  59. end
  60.