Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Joystick
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mikez




PostPosted: Tue Dec 10, 2002 8:37 pm   Post subject: Joystick

What are the commands/sytaxes for using a joystick for turing

ASAP
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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 Very Happy
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Mikez




PostPosted: 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




PostPosted: 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




PostPosted: 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 Smile
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: