Help recognizing borders using View.WhatDotColour
Author |
Message |
canmovie
|
Posted: Sat Oct 16, 2010 12:54 pm Post subject: Help recognizing borders using View.WhatDotColour |
|
|
What is it you are trying to achieve?
I'm making a game where you try to find cheese as a mouse in a maze.
What is the problem you are having?
I used View.WhatDotColour to make the mouse recognize borders, and when I substitute a bmp image of the maze in the background,
View.WhatDotColour does not recognize the borders, and I don't want to draw the whole maze using draw commands.
Describe what you have tried to solve this problem
I tried to substitute an image that has the same exact tone of green that turing uses, and it still won't recognize that it's a border.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
<Add your code here>
|
Please specify what version of Turing you are using
4.1.1 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
copthesaint

|
Posted: Sat Oct 16, 2010 1:47 pm Post subject: Re: Help recognizing borders using View.WhatDotColour |
|
|
lol Call it a rat... I thought you were talking about actually the mouse...
Try making alpha pathing if you wanna use whatdotcolor, That mean drawing black and while underneath your pictures for collision, so for example:
Turing: |
View.Set ("Graphics,Offscreenonly,nobuttonbar")
var mX,mY,mB : int
loop
mousewhere (mX,mY,mB )
drawfillbox (0, 0, 200, 100, black)
drawfillbox (400, 300, 600, 400, black)
if View.WhatDotColor (mX,mY ) = black then
put "Collision!"
View.Update
delay (100)
end if
cls
drawfillbox (0, 0, 200, 100, blue)
drawfillbox (400, 300, 600, 400, purple)
View.Update
cls
end loop
|
|
|
|
|
|
 |
andrew.
|
Posted: Sat Oct 16, 2010 3:18 pm Post subject: Re: Help recognizing borders using View.WhatDotColour |
|
|
copthesaint @ Sat Oct 16, 2010 1:47 pm wrote: lol Call it a rat... I thought you were talking about actually the mouse...
Try making alpha pathing if you wanna use whatdotcolor, That mean drawing black and while underneath your pictures for collision, so for example:
Turing: |
View.Set ("Graphics,Offscreenonly,nobuttonbar")
var mX,mY,mB : int
loop
mousewhere (mX,mY,mB )
drawfillbox (0, 0, 200, 100, black)
drawfillbox (400, 300, 600, 400, black)
if View.WhatDotColor (mX,mY ) = black then
put "Collision!"
View.Update
delay (100)
end if
cls
drawfillbox (0, 0, 200, 100, blue)
drawfillbox (400, 300, 600, 400, purple)
View.Update
cls
end loop
|
That's exactly what thee don't want to do. They said in their post that they don't want to use draw commands to draw each level. They want to be able to make the image (in Paint or something) and just load it in. |
|
|
|
|
 |
copthesaint

|
Posted: Sat Oct 16, 2010 11:14 pm Post subject: RE:Help recognizing borders using View.WhatDotColour |
|
|
So its very hard you know to create a black and white picture? geez... lol
More then likly His problem though might be that he isnt updating his image correctly. |
|
|
|
|
 |
|
|