Computer Science Canada WhatDotColour help |
Author: | bgmrk [ Fri Jan 27, 2006 10:18 am ] | ||
Post subject: | WhatDotColour help | ||
ok i'm trying to make a tag game... only i can't seem to try to get the whatdotcolour to work to know when the two balls collide. I tried to come up with my own methode but it is rather glitchy as you will tell. can some please point me in the right direction. Whether my math is wrong or another method to do this thanx
|
Author: | bgmrk [ Fri Jan 27, 2006 11:55 am ] | ||
Post subject: | |||
oo and another problem i forgot to mention is that i can't seem to get the whatdotcolour to work probably with the borders and the box's on the game map... I've tried but i can't seem to get the object to stop moving. here's what i tried to do...
i want it so the circle just stops moving. and dosen't go around it[/code] |
Author: | Saad85 [ Fri Jan 27, 2006 2:15 pm ] | ||
Post subject: | |||
thats the only use of whatdotcolor i see, and it doesn't do anything, it just makes the variable equal to themselves. in ur second post, why did you make y=y-1? that makes no sense if you dont want it to go around |
Author: | iker [ Fri Jan 27, 2006 5:22 pm ] | ||
Post subject: | |||
why not use something like
and do this for both.. |
Author: | bgmrk [ Fri Jan 27, 2006 6:05 pm ] | ||
Post subject: | |||
Saad85 wrote:
thats the only use of whatdotcolor i see, and it doesn't do anything, it just makes the variable equal to themselves. in ur second post, why did you make y=y-1? that makes no sense if you dont want it to go around ok..that works but wat if i want the circle to be user controled... that x1 := x1 does nothing. it acts like it just ignores it. how would i make it so when it hits it it stops. even though it is user controled |
Author: | RedRogueXIII [ Fri Jan 27, 2006 7:14 pm ] | ||
Post subject: | |||
Use math.distance or if your turing doesnt have it make it. It'll help
if distance between the two ovals is equal to the radius then you have a hit detection. Its also useful for when you have an irregular line boundary and know every point. |
Author: | bgmrk [ Fri Jan 27, 2006 7:36 pm ] | ||
Post subject: | |||
ok i fixed the whole circle colliding thing...however there is a new prob...when i want the circles to touch i want it to change the value of the varible "it" however when ever they collide it just goes back to being true intead of staying on false...how would i fix this here is the new code.
|