Computer Science Canada whatdotcolor help |
Author: | StrikerZ [ Mon Dec 11, 2006 10:03 pm ] | ||
Post subject: | whatdotcolor help | ||
How do i use whatdotcolor to detect color? For example 2 circles make paths both different colors and when one circle hits the other players path, then that person loses. i know whatdotcolor can detect collision between circles but how does it detect the collision between a circle and the other circles path?
|
Author: | Clayton [ Mon Dec 11, 2006 10:17 pm ] |
Post subject: | |
Simply check to see if the color of the pixel you are checking is the color of the "enemy" circle, if it is, that player loses, otherwise, theyre fine. Check out the whatdotcolor tutorial in the Turing Walkthrough for more. |
Author: | StrikerZ [ Mon Dec 11, 2006 10:37 pm ] |
Post subject: | whatdotcolor help |
Thanks for your help, but i have one problem...intcolor1 and intcolor2 are both touching when they collide so player 1 always loses. How do i make the first player to collide lose? |
Author: | TokenHerbz [ Mon Dec 11, 2006 10:40 pm ] |
Post subject: | |
post your code please. How do you want to determine which player loses? |
Author: | Clayton [ Mon Dec 11, 2006 10:51 pm ] |
Post subject: | |
TokenHerbz: Everything is in his first post, read it before you reply... You'll need to keep track of wheter you cross the trailing color (ie, where the circle has been), so you have to check if you cross the tail, and if you do, whos crossing what tail. (If that makes any sense) |