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

  1. Rem * Title  : Flipping a Bob
  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 bob 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 bob
  23. bob 1,100,100,1
  24.  
  25. rem get bob width and find the middle of it going across
  26. rem get bob height and find the middle of it going down
  27. rem new offset for bob 1 
  28.  
  29. offset bob 1,(bob width(1)/2),(bob height(1)/2)
  30.  
  31. rem the is were on screen bob 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 bob
  37.  
  38. print "the flip bob command"
  39. repeat
  40.  
  41.     rem flip bob
  42.     flip bob 1
  43.  
  44.     rem draw the bob at the new position
  45.     bob 1,acrossscreen,downscreen,1
  46.  
  47. until mouseclick()=1
  48.  
  49. rem clear the screen
  50. cls 
  51.  
  52. rem remove the bob from memory
  53. delete bob 1
  54.  
  55. rem remove image 1 from memory
  56. delete image 1
  57.  
  58. rem End the program
  59. end
  60.