every rose has a thorn … every script has a sprite

Cliches get that way by being true. People remember them for the next situation because they have an established track record.

Every script has a sprite that it’s attached to.  If you want to do something in Snap, you pretty much need to hang it on a sprite (or the stage, but that’s a special case). It’s a feature of Snap.   Sprites don’t need scripts.  You can have a sprite sit there on the stage and look pretty and do nothing but you can’t have a script run without there being a sprite for it.

This is important because if you want to do something in a Snap project, you have to decide which sprite is going to be in charge of it.  Suppose there is a game where the player tries to catch falling raindrops in a cup.  If a raindrop lands in the cup, a message is broadcast to add a point to the score. Which sprite sends that broadcast?  The landing raindrop or the receiving cup? There are good arguments either way. It’s up to the coder to decide.  But the coder has to attach it to some sprite.

That’s why I say every script has a sprite.

Leave a Reply

Your email address will not be published. Required fields are marked *