
-----------------------------------
Mikez
Tue Dec 10, 2002 8:37 pm

Joystick
-----------------------------------
What are the commands/sytaxes for using a joystick for turing

ASAP

-----------------------------------
Tony
Tue Dec 10, 2002 9:41 pm


-----------------------------------
Joystick.GetInfo(joystick:int, var xPos, yPos :int. btn1Pressed, btn2Pressed:boolean)

Note that position of joystick is not the same ratio as screen, so you should use

screeX = round(maxx*(xPos-joyMin)/(joyMax - joyMin))
screeY = round(maxy*(yPos-joyMin)/(joyMax - joyMin))

Enjoy, and happy game making  :D

-----------------------------------
Mikez
Sat Dec 14, 2002 9:38 pm


-----------------------------------
can u give an example of the Joystick.GetInfo command cause i don't understand completly

thanx and sorry to bother u

-----------------------------------
Dan
Sat Dec 14, 2002 10:01 pm


-----------------------------------

var x, y :int
var b1, b2 :boolean

loop
     Joystick.GetInfo(1, x, y, b1, b2)
     put "x: ", x
     put "y: ", y
     put "b1: ", b1
     put "b2: ", b2
     put ""
     put ""
end loop


that will give you a costant print out of where the joy sticks x and y is and if it's butions are pushed down. you coude add locate stuff and daylys to this code to make it more readable.

-----------------------------------
hexx
Sun Dec 15, 2002 3:10 pm


-----------------------------------
var x, y :int 
var b1, b2 :boolean 

loop 
     locate (1,1)
     Joystick.GetInfo(1, x, y, b1, b2) 
     put "x: ", x 
     put "y: ", y 
     put "b1: ", b1 
     put "b2: ", b2 
     put "" 
     put "" 
     
end loop

here ya go :)
