This should go in the "Help with Scripts" forum because this is a question about how to script something. I'll have it moved.
I'd have one of the sprites have this script where you want them to hide:
broadcast [hide v] hideand the other sprite have this script:
when I receive [hide v] hideHope this helps!
Last edited by powerpoint56 (2012-08-12 09:58:57)
Offline
Ah, a matching game. Well, it depends on how a match is made. Is it made when two separate cards have the same costume? Or is it differently?
Offline
jminten wrote:
It does help. But I'm trying to do a matching game. So, I need to make it only communicate when a match is made. This is harder than I thought it would be!
Okay then. If you're using a different sprite for each card, then follow these steps.
First you'll need to add this onto whatever is figuring out whether or not you made a match.
if <(match made?) = (true)> broadcast [match! v] endThen add this to your card sprites. Just remember that you'll need to have the card's face-up costume as the second costume:
when I receive [match! v] if <(costume #) = (2)> hide endI hope that this helps!
Offline
Great! For when you draw out the cards, have the player sprite do this:
if <([costume# v] of [card a v]) = ([costume# v] of [card b v])> say [match] for (2) secs next round else say [no match] for (2) secs try againReplace the unreal scratch blocks with the scripts you want for those actions.
Offline
Whatever you want. The two cards could hide using the broadcasting method I showed earlier, you could earn a point, or anything else.
Offline