home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / input / exam11.dba < prev    next >
Encoding:
Text File  |  1999-10-22  |  1.2 KB  |  47 lines

  1. Rem * Title  : Force Feedback B
  2. Rem * Author : DBS-LB
  3. Rem * Date   : 1st Sept 99
  4. rem ============================================
  5. rem DARK BASIC EXAMPLE PROGRAM 11
  6. rem ============================================
  7. rem This program uses special force feedback
  8. rem --------------------------------------------
  9.  
  10. rem Performs a checklist for all contol devices
  11. perform checklist for control devices
  12.  
  13. rem Check for FF flag
  14. ffok=0
  15. for t=1 to checklist quantity()
  16.     if checklist value a(t)=1 then ffok=t
  17. next t
  18.  
  19. rem Assume the first one is a force feedback device
  20. if ffok=0
  21.     print "You have no force feedback control devices available!"
  22.     print "Cannot continue with example"
  23.     end
  24. else
  25.     set control device checklist string$(ffok)
  26. endif
  27.  
  28. rem Begin main loop
  29. do
  30.  
  31. rem Use the number keys to control force effects
  32. if inkey$()="1" then force chainsaw 100,0
  33. if inkey$()="2" then force shoot 100,300 : sleep 300
  34. if inkey$()="3" then force impact 100,0
  35.  
  36. rem Use the shift key to activate auto center
  37. if shiftkey()=1 then force auto center on
  38.  
  39. rem Use the return key to activate water effect
  40. if returnkey()=1 then force water effect 100,0
  41.  
  42. rem Use the spacebar to cancel all effects
  43. if spacekey()=1 then force no effect
  44.  
  45. rem End the loop
  46. loop
  47.