home *** CD-ROM | disk | FTP | other *** search
/ Game Programming for Teens / GameProgrammingForTeens.iso / Source / chapter07 / demo07-10.bb < prev    next >
Encoding:
Text File  |  2004-08-28  |  720 b   |  34 lines

  1. ;demo07-10.bb - A bad real-time rotation program
  2.  
  3. Graphics 800,600
  4. ;Grab Images by the center
  5. AutoMidHandle True
  6.  
  7. ;Initialize Back Buffer
  8. SetBuffer BackBuffer()
  9.  
  10. ;IMAGES
  11. ;Load the ship image that will be rotated
  12. shipimage = LoadImage ("spaceship.bmp")
  13.  
  14.  
  15. Print "Press Left to rotate counter-clockwise and right to rotate clockwise,"
  16. Print "Press Esc to exit."
  17.  
  18. ;MAIN LOOP
  19. While Not KeyDown(1)
  20. ;Clear the Screen
  21. Cls
  22.  
  23. ;If the player presses left, rotate four degrees right, if he presses left, rotate four degrees right
  24. If KeyDown (203) 
  25.     RotateImage shipimage, -4
  26. ElseIf KeyDown (205) 
  27.     RotateImage shipimage,4
  28. EndIf
  29.  
  30. ;Draw the ship
  31. DrawImage shipimage, 400,300
  32. Flip
  33. Wend
  34. ;END OF MAIN LOOP