Joystick
Author |
Message |
Mikez
|
Posted: Tue Dec 10, 2002 8:37 pm Post subject: Joystick |
|
|
What are the commands/sytaxes for using a joystick for turing
ASAP |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue Dec 10, 2002 9:41 pm Post subject: (No subject) |
|
|
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 |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Mikez
|
Posted: Sat Dec 14, 2002 9:38 pm Post subject: (No subject) |
|
|
can u give an example of the Joystick.GetInfo command cause i don't understand completly
thanx and sorry to bother u |
|
|
|
|
|
Dan
|
Posted: Sat Dec 14, 2002 10:01 pm Post subject: (No subject) |
|
|
code: |
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. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
hexx
|
Posted: Sun Dec 15, 2002 3:10 pm Post subject: (No subject) |
|
|
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 |
|
|
|
|
|
|
|