home *** CD-ROM | disk | FTP | other *** search
/ Game Programming for Teens / GameProgrammingForTeens.iso / Source / chapter10 / demo10-10.bb < prev    next >
Encoding:
Text File  |  2003-04-06  |  499 b   |  27 lines

  1. ;demo10-10.bb - Demonstrates use of MouseZ()
  2.  
  3. ;Set up graphics and backbuffer
  4. Graphics 800,600
  5. SetBuffer BackBuffer()
  6.  
  7.  
  8. ;Load images
  9. backgroundimage = LoadImage("stars.bmp")
  10. shipimage = LoadImage("ship.bmp")
  11.  
  12. ;MAIN LOOP
  13. While Not KeyDown(1)
  14.  
  15. ;Scroll the background 20 pixels with each mouse wheel scroll
  16. scrolly = MouseZ() * 20
  17.  
  18. ;Tile the background
  19. TileBlock backgroundimage,0,scrolly
  20.  
  21.  
  22. ;Draw the player
  23. DrawImage shipimage, MouseX(), MouseY()
  24.  
  25. Flip
  26. Wend
  27. ;END OF MAIN LOOP