Line 9 gives a missing factor error (line 10 I corrected there was a missing bracket from the pdf); I have tried "bounds" "opaque pixels" and 255 without the quotes since I read they are not required anymore. I have read previous posts but can not find any more ideas. My LC version is 6.1.2 community ed.
Chris
Code: Select all
on sheepGenerate -- Only just lines A B C of this generate new btns every mouseup
lock screen
repeat with x=1 to sLevel
repeat
clone btn "templateSheep" --A
set the name of the last btn to ("sheep" & x)
set the loc of last btn to random(320), random(480) --B
set the visible of the last button to true --C
if intersect (btn ("sheep" & x),grc "pen" , "255") is false and
intersect (btn ("sheep"&x), grp "groupControls" , "0") is false then
exit repeat
end if
delete btn ("sheep" & x)
end repeat
if the top of button ("sheep"&x) < the top of this card then
set the top of button ("sheep"&x) to the left of this card
end if
if the left of button ("sheep"&x) < the left of this card then
set the left of button ("sheep"&x) to the left of this card
end if
if the right of button ("sheep"&x) > the right of this card then
set the right of button ("sheep"&x) to the right of this card
end if
if the bottom of button ("sheep"&x) > the bottom of this card then
set the bottom of button ("sheep"&x) to the bottom of this card
end if
end repeat
unlock screen
end sheepGenerate