Computer Science Canada help with modify programming code |
Author: | DAV1209 [ Tue Oct 28, 2003 4:07 pm ] | ||
Post subject: | help with modify programming code | ||
here is the original programming code:
how can i modify the program so the ball will continue to travel indefinitely and also the ball will bounce when it reaches any edge of the table.( The angle of incidence is equal to the angle of reflection). |
Author: | thoughtful [ Tue Oct 28, 2003 5:18 pm ] | ||
Post subject: | |||
To keep it moving you have to change the for statement to a loop statement. For the bouncing part look at my if statement in the loop.
Basically if the bally is greater than tabley2 or less the tabley1, it reflects the y speed. Same for the x. PS: Use offscreen only and view update for smooth animations, dont draw a ball over the last one to hide it ![]() ![]() |
Author: | Tony [ Tue Oct 28, 2003 5:36 pm ] |
Post subject: | |
if you're interested, you can also take a look at some fine examples of pool games programmed in turing. Just borwse the forum or use the Search. |
Author: | thoughtful [ Tue Oct 28, 2003 5:38 pm ] |
Post subject: | |
or wait till i rite my pool & collision detection tutorial ![]() ![]() |
Author: | DAV1209 [ Wed Oct 29, 2003 5:34 pm ] |
Post subject: | |
Quote: PS: Use offscreen only and view update for smooth animations where can i find the update for it |
Author: | Tony [ Wed Oct 29, 2003 6:22 pm ] |
Post subject: | |
You'd need the latest version of Turing - 4.something. If you already have v4 installed, go to HoltSoft and download the patch. If you don't have it... well you'd have to find it somewhere ![]() |
Author: | DAV1209 [ Thu Oct 30, 2003 5:39 pm ] |
Post subject: | |
Quote: If you already have v4 installed, go to HoltSoft and download the patch. If you don't have it... i look for the patch but couldn't find it can you give me the link to the patch thanks |
Author: | Dan [ Fri Oct 31, 2003 8:45 pm ] |
Post subject: | |
http://www.holtsoft.com/turing/support/#turing4patches they realy should wrok on there layout, hard to find anything. |