Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
command moveEnemy
if field "f1" is empty then
move image "Knight 2" to random(800), random(600) in 2 seconds
end if
if field "f1" is empty then
move image "Knight 45" to random(800), random(600) in 2 seconds
end if
send "moveEnemy" to me in 2 secs
end moveEnemy
On attempting to quite the LC IDE the 'thing' gets caught at move image "Knight 45" to random(800), random(600) in 2 seconds and will NOT quit.
command moveEnemy1
if field "f1" = empty then
move image "Knight 2" to random(800), random(600) in 2 seconds
end if
send "moveEnemy2" to me in 2 secs
end moveEnemy1
command moveEnemy2
if field "f1" = empty then
move image "Knight 45" to random(800), random(600) in 2 seconds
end if
send "moveEnemy1" to me in 2 secs
end moveEnemy2
Maybe test with "... move... without waiting"
AND add a way to CANCEL the MOVEs when neccessary!
command moveEnemy
if field "f1" is empty then
move image "Knight 2" to random(800), random(600) in 2 seconds
end if
if field "f1" is empty then
move image "Knight 45" to random(800), random(600) in 2 seconds
end if
send "moveEnemy" to me in 2 secs
end moveEnemy
On attempting to quite the LC IDE the 'thing' gets caught at move image "Knight 45" to random(800), random(600) in 2 seconds and will NOT quit.
1. Why the two “if” statements? The condition is the same, why not have them as a single conditional?
2. The only way to terminate this handler is to put something into field “f1” - why not do that when trying to quit? Or clear the pending messages…
Well, while yon sleepy bairn gets himsel sairted oot, I have deleted his "chunky monkey" and uploaded a 'pruned' stack with a some cardScript mods (all clearly marked).