
-----------------------------------
upthescale
Tue May 02, 2006 4:30 pm

What Dot Color
-----------------------------------
Ok, would anyone mind helping me? Please! OMG Please! oh yah i haven't asked the question! anyway...i madeto walls, one wall is on the one side of the turing screen, and can u guess where the other is? on the other side of the turing screen! so it looks like this...

|             |
|             |
|             |
|             |
|             |
|             |


but the thing is, i amde them in flash and they have a funky design....now i have a box that is attached to the mouse (mosuewhere)...i want a detection so when my box hits the walls, the program will say 
put"Detection" 

(for now it will say that, just so i know the code works)

so i tried whatdotcolor...the variable for the boxo n my mouse is boxx, and boxy

this is what i am trying to do:

if whatdotcolor (boxx,boxy) = 7 then
put"Detection Occured"
end id


Even though the walls are black....it dosn't work. Is this becasue the walls are a file?

Someone please help!

thanks,
Robbie!

-----------------------------------
HellblazerX
Tue May 02, 2006 4:40 pm


-----------------------------------
Errrr, did you make sure you actually drew those walls onto the screen, because from when you say the walls are a file, it sounds like you're reading coordinates off of the file and attempting collision detection with them.

-----------------------------------
md
Tue May 02, 2006 4:41 pm


-----------------------------------
Umm... you might want to check out hte [[turing tutorials]] forum and read the whatdotcolor (what a stupid name...) tutorial. Since your using strait lines though it's just a ssimple to use math to do boundried. If boxx < LEFT_WALL_X or > RIGHT_WALL_X then you'd hit hte wall.

-----------------------------------
upthescale
Tue May 02, 2006 4:46 pm


-----------------------------------
ok ehre are the walls...if i sued x> boxx otr w/e, its an irregular shaped object os it wudnt werk to well

-----------------------------------
TokenHerbz
Tue May 02, 2006 7:10 pm


-----------------------------------
maybe your whatdotcolor wont work because its "seeing" the color of the box following your mouse...  try whatdotcoloring beyond the box's points...


I never downloaded your program so im guessing on how you have it saet up.

try whatdotcolor the chords 1 outside the box's side... and try that...

Note:  Dont wine about not receving help, you'll get it in time

-----------------------------------
do_pete
Tue May 02, 2006 7:26 pm


-----------------------------------
You should use math instead of whatdotcolour

-----------------------------------
codemage
Wed May 03, 2006 8:49 am


-----------------------------------
You have to be careful with wdc.

The order of things that you draw on screen is crucial, because wdc looks at your screen in the instance where it is called - which is not necessarily the same screen that the user sees (or the programmer intended...)

-----------------------------------
MysticVegeta
Wed May 03, 2006 1:33 pm


-----------------------------------
Also, notice how whatdotcolor has limited capabilities (for ints only) Math.Distance works in reals too. So its far more accurate, eh?

-----------------------------------
upthescale
Wed May 03, 2006 3:43 pm


-----------------------------------
my turing sdoesn't allow Math.Distance...pretty gay

-----------------------------------
do_pete
Wed May 03, 2006 4:02 pm


-----------------------------------
Then make your own.

-----------------------------------
md
Wed May 03, 2006 4:38 pm


-----------------------------------
ffs; math.distance is just using hte pythagorean theorem:
Here it is in C++... since giving it to you in turing is jsut making it too easy for you.
real Distance(point a, b) { return sqrt( sqr(a.x -b.x) + sqr(a.y - b.y) ); }
