home *** CD-ROM | disk | FTP | other *** search
/ Game Programming for Teens / GameProgrammingForTeens.iso / Source / chapter07 / demo07-01.bb < prev    next >
Encoding:
Text File  |  2003-04-06  |  619 b   |  35 lines

  1. ;demo07-01.bb - Demonstrates Translation
  2. Graphics 640,480
  3.  
  4. ;Set up backbuffer and AutoMidHandle
  5. SetBuffer BackBuffer() 
  6. AutoMidHandle True 
  7.  
  8. ;IMAGES
  9. ;The image that will be drawn on screen
  10. shipimage = LoadImage("enemy.bmp") 
  11.  
  12. ;Make ship's coordinates begin at top left corner
  13. shipx = 0
  14. shipy = 0
  15.  
  16.  
  17. ;MAIN LOOP
  18. While Not KeyDown(1)
  19.  
  20. ;Clear the screen
  21. Cls
  22.  
  23. ;Draw the ship
  24. DrawImage shipimage,shipx,shipy ;Draw the ship image
  25.  
  26. ;Translate the ship image 7 pixels right and 5 pixels down
  27. shipx = shipx + 7
  28. shipy = shipy + 5
  29.  
  30. ;Wait a (fraction of a ) sec
  31. Delay 50
  32.  
  33. Flip
  34. Wend
  35. ;END OF MAIN LOOP