Hi noel1 - It's not really intended to be a finished project. It's just a demonstration of a technique for another Scratcher. Thanks for the comments though!
This project shows one way to implement randomly activated sprites in response to a question in the Forum.
Every time the Green Flag is pressed, the red balls will approach the Cat sequentially in a random order.
At the Green Flag start, each Red Ball sprite assigns itself a number which it puts in a local variable called Number. They pull these numbers from a global variable called Sprite Number to insure that the same number isn't used twice. They wait a random amount of time (less than a second) before pulling their number to insure that the order is random.
Then, once activated, each Red Ball sprite waits until their number is equal to another global variable, called Sprite to Send, at which point they move towards the Cat.
The Cat signals for the first Ball to start moving but after that each Ball will signal for the next one in turn until all the Balls have moved.
Comments
You need to be logged in to post comments
Add a Comment
do you know a way to obtain random numbers without using the "pick number between _ and _" script?
No...I suppose you could write your own random number routine.
Hi noel1 - It's not really intended to be a finished project. It's just a demonstration of a technique for another Scratcher. Thanks for the comments though!
I LOVE it!!!!!
Plan but cool! I like it alot!
Cool