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

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




PostPosted: Fri Dec 15, 2006 9:47 am   Post subject: Moving Objects

How would you be able to allow the user to click and move shapes on the output screen... I am tring to create a design thatwill test a young students ability to to put 5 blocks in order from smallest to largest. There will be 5 blocks displayed randomly with 5 boxes below them.. how would I allow the user to click on a box, drag it into a sqare, and have the program know when they have been placed correctly?
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Fri Dec 15, 2006 12:35 pm   Post subject: (No subject)

You'll have to use Mouse.Where. Check that out in the Turing manual if you're not already familiar with it.

You'll also probably have to do some work to keep track of whether you're grabbing onto a block or not. Why don't you give it a try and post what code you come up with? Or if not that, post some pseudo code. Or just try to talk your way through it. We'll help you out on this, but it's best if you solve the problem mostly by yourself. That's how people truly learn best.
Piro24




PostPosted: Fri Dec 15, 2006 3:58 pm   Post subject: (No subject)

Use Mouse.Where...If button = 1 (pressed) and the x co-ordinate of the mouse and the y co-ordinates of the mouse are inside of the box, then make the x co-ordinate and y co-ordinates of the box = the x and y co-ordinates of the mouse.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: