Computer Science Canada Help with Tony's Oval Collision. |
Author: | recneps [ Wed Jan 28, 2004 6:46 pm ] |
Post subject: | Help with Tony's Oval Collision. |
Help with Tony's Oval Collision please! I'm going to include a racing game in my FP (a real crappy one, but its better than my High/Low game ;p) Anyways, i got the car movement down, and i tried tony's oval collison so that it would stop at the oval (well move back 10 spots) but its not working... anyone help me? ![]() ![]() |
Author: | poly [ Wed Jan 28, 2004 6:49 pm ] |
Post subject: | |
so when the car hits the oval, it gets sent flying back 10 spots? - try using View.Update so there is no blinking |
Author: | recneps [ Wed Jan 28, 2004 6:52 pm ] |
Post subject: | |
I have view.update in there... im thinking i put one in the procedure, but not the loop ![]() ![]() |
Author: | santabruzer [ Wed Jan 28, 2004 6:57 pm ] | ||||
Post subject: | |||||
dont' forgot to put the screen mode before the procedure, or the other way around example :
instead of
Reduces Flicker |
Author: | McKenzie [ Wed Jan 28, 2004 7:04 pm ] |
Post subject: | |
Distance formula is wrong. (no need for credit) |
Author: | Cervantes [ Thu Jan 29, 2004 8:30 am ] |
Post subject: | |
If you're using turing 4.0.5 you can just use Math.Distance (x1, y1, x2, y2) cheers |
Author: | shorthair [ Thu Jan 29, 2004 8:55 am ] |
Post subject: | |
im not to sure how exactly t ochange this , but i am aware that you can have a much better turning and drving game , so that you can drive while your turning , that would be really cool |
Author: | Delta [ Thu Jan 29, 2004 9:11 am ] |
Post subject: | |
you should have the turning do like a little arc (sin or cos type deal) so the car doesn't just go up,down,left,right... as for the turning a moving at the same time use Key.Down ... ummm ya... have fuN! |
Author: | McKenzie [ Thu Jan 29, 2004 9:57 am ] |
Post subject: | |
basically you want to see the velocity of the car as a vector (magnitude (speed) and direction (angle that you already have)). Just break this vector into it's x any components and that is how much to add on when it moves. Here is a simple vector example to get you on your way. |
Author: | Delta [ Thu Jan 29, 2004 11:45 am ] |
Post subject: | |
wow... mckenzie you should make a yo yo game with that code... it'd be super kewl.. like wow... now if you don't (i think you should ![]() ![]() |
Author: | Cervantes [ Fri Jan 30, 2004 9:30 am ] |
Post subject: | |
wow I like that program McKenzie.... yeeees.. like it I do... a yoyo program, that is original!! but it would only be cool if you could do all sorts of cool tricks... but the tricks would have to actually be done, not by hitting a certain button comination and then it does the trick (like what you have in mortal combat or games like those) Cheers |
Author: | recneps [ Fri Jan 30, 2004 6:44 pm ] | ||
Post subject: | |||
ok, i got it to stop at the edge of the circle, but how can i get it to move out of it?
|
Author: | McKenzie [ Sat Jan 31, 2004 12:50 am ] |
Post subject: | |
Prevention is the key (see code) |
Author: | Andy [ Sat Jan 31, 2004 3:35 pm ] |
Post subject: | |
turing now has a built in function to check the distance between two points |
Author: | Cervantes [ Sat Jan 31, 2004 3:43 pm ] |
Post subject: | |
called Math.Distance *points to 6th post from top* |
Author: | recneps [ Sat Jan 31, 2004 5:45 pm ] |
Post subject: | |
I also used that Math Distance thing in my "updated code" |