Loading ...
Sorry, an error occurred while loading the content.

Reading Joysticks ---Help Please

Expand Messages
  • johnrgillespiejr
    Yesterday I posted asking for help, and found my copy and past did not go so good. I still can Not read and input joystick position feed back into my y axis.
    Message 1 of 2 , Oct 18, 2011
    • 0 Attachment
      Yesterday I posted asking for help, and found my copy and past did not go so good. I still can Not read and input joystick position feed back into my y axis. I'm only trying to controle Y axis at this time.
      I am able to do Ketboard Inputs yo controle Sprite position. Today I'll work on using a mouse to controle position, and be checking here all day hoping for Joystick Help- LOL Thank you all. JG.




      ' short animation program with LB sprites



      nomainwin
      loadbmp "BG1", "sprites\BG1.bmp":loadbmp "2men", "sprites\2men.bmp"
      WindowWidth = 1024 :WindowHeight = 768
      open "Joystick help" for graphics_nf_nsb as #wg
      #wg, "background BG1";
      #wg, "addsprite men 2men";
      #wg, "cyclesprite men 1"
      mx=-5 : my=384
      #wg "setfocus"
      #wg "when characterInput [update]"

      timer 20, [draw]
      wait
      [update]
      readjoystick 1
      ' #w.g Joy1x, Joy1y, Joy1z, Joy1button1, Joy1button2

      ' I have no idea how to use the 2 lines above this note in orde to gain controle of my moving sprite. Please help if
      ' you can with a short sample Joystick program or add the need commands to this one
      ' I can't find any sample JS programs. Thank You. JG


      [draw]
      cycle=cycle+1
      if cycle=620 then [quit]
      my=384 ' << How to get controle of sprite in y, with Joystick
      mx=mx+5
      if mx>1025 then mx=-5
      #wg, "spritexy men ";mx;" ";my
      #wg, "drawsprites"

      wait
      [quit]
      timer 0:close #wg:end
    • Rod
      I responded to this ages ago. http://groups.yahoo.com/group/libertybasic/message/43867
      Message 2 of 2 , Nov 3, 2011
      • 0 Attachment
        I responded to this ages ago. http://groups.yahoo.com/group/libertybasic/message/43867

        --- In libertybasic@yahoogroups.com, "johnrgillespiejr" <johnrgillespiejr@...> wrote:
        >
        > Yesterday I posted asking for help, and found my copy and past did not go so good. I still can Not read and input joystick position feed back into my y axis. I'm only trying to controle Y axis at this time.
        > I am able to do Ketboard Inputs yo controle Sprite position. Today I'll work on using a mouse to controle position, and be checking here all day hoping for Joystick Help- LOL Thank you all. JG.
        >
        >
        >
        >
        > ' short animation program with LB sprites
        >
        >
        >
        > nomainwin
        > loadbmp "BG1", "sprites\BG1.bmp":loadbmp "2men", "sprites\2men.bmp"
        > WindowWidth = 1024 :WindowHeight = 768
        > open "Joystick help" for graphics_nf_nsb as #wg
        > #wg, "background BG1";
        > #wg, "addsprite men 2men";
        > #wg, "cyclesprite men 1"
        > mx=-5 : my=384
        > #wg "setfocus"
        > #wg "when characterInput [update]"
        >
        > timer 20, [draw]
        > wait
        > [update]
        > readjoystick 1
        > ' #w.g Joy1x, Joy1y, Joy1z, Joy1button1, Joy1button2
        >
        > ' I have no idea how to use the 2 lines above this note in orde to gain controle of my moving sprite. Please help if
        > ' you can with a short sample Joystick program or add the need commands to this one
        > ' I can't find any sample JS programs. Thank You. JG
        >
        >
        > [draw]
        > cycle=cycle+1
        > if cycle=620 then [quit]
        > my=384 ' << How to get controle of sprite in y, with Joystick
        > mx=mx+5
        > if mx>1025 then mx=-5
        > #wg, "spritexy men ";mx;" ";my
        > #wg, "drawsprites"
        >
        > wait
        > [quit]
        > timer 0:close #wg:end
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.