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

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




PostPosted: Mon Dec 12, 2005 6:55 am   Post subject: tURING-MAZE

HEY U GUYS . I JUS STARTED LEARNIN ABOU TTURING AND NEED HELP WITH THIS MAZE GAME. i NEED HELP ON WRTIING THE CODE THAT DOESN'T ALLOW THE BALL TO GO OFF SCREEN.
Sponsor
Sponsor
Sponsor
sponsor
Hikaru79




PostPosted: Mon Dec 12, 2005 8:20 am   Post subject: (No subject)

PRESHANA wrote:
HEY U GUYS . I JUS STARTED LEARNIN ABOU TTURING AND NEED HELP WITH THIS MAZE GAME. i NEED HELP ON WRTIING THE CODE THAT DOESN'T ALLOW THE BALL TO GO OFF SCREEN.


Here's two tips.

1) Don't yell.

2) 'maxx' and 'maxy' are the constants that represent the maximum dimensions of the Turing window.
code:
if ballx <= maxx and ballx >= 0 and bally <= maxy and bally >=0 then
     #The ball is inside the screen.
end if
Tony




PostPosted: Mon Dec 12, 2005 9:50 am   Post subject: (No subject)

The Caps-Lock is usually located on the left side of the keyboard, to the left of A.. try looking for it.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
do_pete




PostPosted: Mon Dec 12, 2005 11:11 am   Post subject: (No subject)

Hikaru79 wrote:
code:
if ballx <= maxx and ballx >= 0 and bally <= maxy and bally >=0 then
     #The ball is inside the screen.
end if


Or you can go like this
code:

Ball_X := min (maxx - RADIUS, max (RADIUS, Ball_X))
Ball_Y := min (maxy - RADIUS, max (RADIUS, Ball_Y))
MysticVegeta




PostPosted: Mon Dec 12, 2005 1:19 pm   Post subject: (No subject)

Off topic: hmm perhaps the caps was on, notice how to title is tURING. the "t" is small. Dont you look at the screen once when you type :S

On topic: There is an example of a bouncing ball and going tangentially on the boundary in the Turing manual. I believe its in the Music.x command.
Dan




PostPosted: Mon Dec 12, 2005 1:27 pm   Post subject: (No subject)

For more info on such a topic one could sreach the turing sections for collision detection. There should be many topics on the subject and many difrent methods or doing this.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
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  [ 6 Posts ]
Jump to:   


Style:  
Search: