Intersect
Posted: Tue Nov 05, 2013 8:51 pm
on mouseUp
put the loc of btn "mover" into startloc
repeat until intersect (btn "mover", btn "theTarget") = "true"
get the loc of btn "mover"
set the loc of btn "mover" to (item 1 of it + 1) & "," & (item 2 of it)
-- adding 1 to this item 2 makes it move diagonally EG (item 2 of it +1)
wait 0.25
end repeat
set the loc of btn "mover" to startloc
end mouseUp
This script I culled from a tutorial by Dave from 2012 when I was looking up about two objects colliding instead of passing through each other, I understand the tutorial he gives except for this one point here below:
As you can see the intersect here is actually a function, but the problem here is that when I click on the word in the IDE the documentation brings it up as a Command.
thankyou
chris
put the loc of btn "mover" into startloc
repeat until intersect (btn "mover", btn "theTarget") = "true"
get the loc of btn "mover"
set the loc of btn "mover" to (item 1 of it + 1) & "," & (item 2 of it)
-- adding 1 to this item 2 makes it move diagonally EG (item 2 of it +1)
wait 0.25
end repeat
set the loc of btn "mover" to startloc
end mouseUp
This script I culled from a tutorial by Dave from 2012 when I was looking up about two objects colliding instead of passing through each other, I understand the tutorial he gives except for this one point here below:
As you can see the intersect here is actually a function, but the problem here is that when I click on the word in the IDE the documentation brings it up as a Command.
thankyou
chris