
-----------------------------------
Varsteil
Fri Dec 23, 2011 8:29 am

I can't seem to get detection to work on my program
-----------------------------------
What is it you are trying to achieve?



What is the problem you are having?



Describe what you have tried to solve this problem


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using


-----------------------------------
Dreadnought
Fri Dec 23, 2011 5:57 pm

Re: I can't seem to get detection to work on my program
-----------------------------------
First off, I see you're using processes. I suggest you read the documentation about Input.KeyDown and maybe hasch, they might make your life easier.

Onto the problem at hand.
drawfillbox (0, y, 640, y1, black)
drawfillbox (x, y, x1, y1, white)
drawfillbox (boxx, boxy, boxx2, boxy2, blue)
if whatdotcolor (boxx2, boxy2) = black then
Can/is the pixel (boxx2, boxy2) ever black? If not then what is its colour? Try replacing your whatdotcolour check with
locate (1,1)
put whatdotcolour (boxx2, boxy2)
the result should tell you what the problem is.

Let's also look at this code (I left out the unimportant parts):
loop
getch (move)
if move = chr (203) then
elsif whatdotcolor (boxx2, boxy2) = black then
elsif move = chr (205) then
elsif whatdotcolor (boxx2, boxy2) = black then
end if
Since getch halts the process, the if statement will only execute immediately after a key press. This isn't exactly what you want. Also, if the first condition "move = chr (203)" is true, are the other conditions checked? 

But the real problem is in the first piece of code I posted.
