home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / riblitzlibs.lha / riblitzlibs / zonejoy / JoyTest.asc next >
Encoding:
Text File  |  1994-04-26  |  851 b   |  24 lines

  1. ;##########################
  2. ;# Example 1.3 - Joystick #
  3. ;##########################
  4. ;By Steven Matty
  5.  
  6. ;This program will print up joystick movements for specified joystick
  7. ;ports (1=Joystick 1, 2=Mouse Port, 3=4-Player(Port1) 4=4-Player(Port2)
  8. ;To quit, press the fire button on all specified joysticks
  9.  
  10. NPrint "Enter DECIMAL value For joysticks To test (15=All)"
  11. bitpattern.b=Edit(15,4)
  12. Repeat
  13.   For n=1 To 4
  14.     If bitpattern BitTst (n-1)
  15.       If JFire(n) Then NPrint "Player ",n," pressed fire!"
  16.       If JHoriz(n)=-1 Then NPrint "Player ",n," pressed left!"
  17.       If JHoriz(n)=1 Then NPrint "Player ",n," pressed right!"
  18.       If  JVert(n)=-1 Then NPrint "Player ",n," pressed up!"
  19.       If JVert(n)=1 Then NPrint "Player ",n," pressed down!"
  20.     End If
  21.   Next n
  22. Until AllFire(bitpattern)=bitpattern  ; Until JFire(1) and JFire(2) = PRESSED!
  23. End
  24.