Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » "Glide to" command interuption
- Binary_Leader
-
2 posts
"Glide to" command interuption
Hello Everybody,
just thinking about “glide to” command interuption while this command is beiing processed.
For example, there is an object, which is moving through the screen to some position used glide to command for 3 seconds, but I want to check during this motion, if conditions for this move are still keeped, for example each 100ms.
just thinking about “glide to” command interuption while this command is beiing processed.
For example, there is an object, which is moving through the screen to some position used glide to command for 3 seconds, but I want to check during this motion, if conditions for this move are still keeped, for example each 100ms.
- awesome-llama
-
1000+ posts
"Glide to" command interuption
The glide blocks are a bit limiting as they can't easily be stopped.
The way I know to stop it is through this block:
Just note that it will stop all other scripts in the sprite, except itself.
The way I know to stop it is through this block:
Just note that it will stop all other scripts in the sprite, except itself.
- Binary_Leader
-
2 posts
"Glide to" command interuption
Yes, stop all other scripts is not good solution in this case. Probably only solution is to divide the trajectory to small partitions and after each movement perform other code part. This is unnecessarily complicated.
- MasterofTheBrick
-
1000+ posts
"Glide to" command interuption
Or you could just point in the direction of the place you want to go, and repeatedly use the move () steps block. It would be easier to stop the movement using variables rather than using the stop block and potentially causing the more important scripts in your sprite to stop as well.
- TommyNator11
-
63 posts
"Glide to" command interuption
I would never use a “Glide to Block” for projectiles. If you want to inturrupt it, use Yes, stop all other scripts is not good solution in this case. Probably only solution is to divide the trajectory to small partitions and after each movement perform other code part. This is unnecessarily complicated.
- Discussion Forums
- » Help with Scripts
-
» "Glide to" command interuption