sheep herder game Cant grab sheep.
Posted: Thu Apr 10, 2014 2:47 pm
Dear community.
I have been studying the lessons from the academy courses but i am getting stuck .
Here is the code that i got from the lessons. Can you tell me what is wrong ?
Local sImASheep
on mouseDown
if the cIsSheep of the target is true then
put true into sImASheep
end if
end mouseDown
on mouseMove
if sImASheep is true then
set the loc of the target to the mouseLoc
if intersect (the target, Graphic "pen", 255) and the cIsSheep of the target is true then
set the backgroundcolor of the graphic "pen" to "red"
else
set the backgroundcolor of the graphic "pen" to "blue"
end if
end if
end mouseMove
I have been studying the lessons from the academy courses but i am getting stuck .
Here is the code that i got from the lessons. Can you tell me what is wrong ?
Local sImASheep
on mouseDown
if the cIsSheep of the target is true then
put true into sImASheep
end if
end mouseDown
on mouseMove
if sImASheep is true then
set the loc of the target to the mouseLoc
if intersect (the target, Graphic "pen", 255) and the cIsSheep of the target is true then
set the backgroundcolor of the graphic "pen" to "red"
else
set the backgroundcolor of the graphic "pen" to "blue"
end if
end if
end mouseMove