Posted: 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
Hikaru79
Posted: 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
Posted: 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.
Posted: 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
Posted: 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
Posted: 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 CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!