What I noticed was that the keysdown function would not work without that stack scripting. So I threw it away and did what you see here. Now, it also seems that the scripting in the UNCOMMENTED part of the dropmines also does not work without the stack scripting (referring to what I said above). The Commented line you see here is how I tested the intersect method. What now happens is that everytime I press the start button, the mine drops one pixel per mouseup click. I understand what is happening, but I do not understand why it is happening.
My question therefore is this: Do only certain types of scripting (animation wise) only work when there is a background loop in place such as is found in the well-known animation stack script involving screen updating and frame rates and dispatching updated screen information etc.
thankyou
chris
Code: Select all
on dropMines
--move btn "mine1" from 176,93 to 176,191 without waiting
set the top of btn "mine1" to the top of btn "mine1" + 1
if the top of btn "mine1" > the bottom of card "sendSurface" then
set the loc of btn "mine1" to 327,0
end if
end dropMines
Code: Select all
on startSequence
send "sub3" to me in 2 seconds
send "sub2" to me in 1200 milliseconds
send "sub1" to me in 600 milliseconds
end startSequence
on sub1
set the icon of button "buttonsubbb" to the id of img "blacksub1.png"
end sub1
on sub2
set the icon of button "buttonsubbb" to the id of img "blacksub2.png"
end sub2
on sub3
set the icon of button "buttonsubbb" to the id of img "blacksub3.png"
end sub3
Code: Select all
on arrowkey pKey
if pKey = "left" then
set the left of button "buttonsubbb" to the left of button "buttonsubbb" -1
end if
if pKey = "right" then
set the right of button "buttonsubbb" to the right of button "buttonsubbb" +1
end if
if pKey = "up" then
move button "buttonsubbb" relative +1,-1
end if
if pKey = "down" then
move button "buttonsubbb" relative +1,+1
end if
end arrowkey