Hi there, a student of mine wants to know how to click a sprite a certain amount of clicks, for then a new sprite to be visible. We cannot seem to figure this out.
Thanks!
Hi there, a student of mine wants to know how to click a sprite a certain amount of clicks, for then a new sprite to be visible. We cannot seem to figure this out.
Thanks!
Hello!
Here is some sample code that you can share with them to see if it helps. You are basically creating a counter (called clicks) that checks to see how many times you click the mouse when it is over the desired sprite.
Then, when that counter reaches 10, it runs switches the sprite’s animation.
Let me know how it goes!
Mike
If you want the new sprite not to be just a costume change, but actually a new sprite, similar code would work, but you would need to set the visibility of the first sprite to 0 bear.visible = 0;
and set the visibility of the 2nd sprite to be visible chick.visible = 1;
instead of changing the Animation.
Mike