home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / b / bb13.zip / SAMPLEG2.BAS < prev    next >
BASIC Source File  |  1992-08-24  |  787b  |  58 lines

  1.  
  2.  
  3. rem
  4. rem Demonstration of graphics mode and mouse usage.
  5. rem
  6.  
  7.  
  8. rem
  9. rem Go into graphics mode and find out how big window is
  10. rem
  11.  
  12.     screen 1000
  13.     maxx=system(10)-1
  14.     maxy=system(11)-1
  15.  
  16.  
  17. rem
  18. rem turn mouse on
  19. rem
  20.  
  21.     a=mouseon
  22.     if a=0 then
  23.       print "This program requires a mouse."
  24.       input z
  25.       stop
  26.     end if
  27.  
  28.  
  29. rem
  30. rem loop and look for buttons
  31. rem
  32. rem  If left button pressed, color pixel where we are.
  33. rem  If right button pressed, set pixel where we are to background color
  34. rem
  35.  
  36. 100
  37.  
  38.      x=mousex
  39.      y=mousey
  40.      b=mouseb
  41.  
  42.      right=b and 1
  43.      if right>0 then
  44.     pset (x,y)
  45.     goto 100
  46.      end if
  47.  
  48.      left=b and 2
  49.      if left>0 then
  50.        preset (x,y)
  51.        goto 100
  52.      end if
  53.  
  54.      goto 100
  55.  
  56.  
  57.  
  58.