Discuss Scratch

amazethisrabble
New to Scratch
3 posts

Making sprites count in unison

I'm brand new to Scratch and working on an animation of a game of Sardines. I want three of my four sprites to count to ten in unison, but I can't seem to figure out how.

I started by simply having one character broadcast “count” and the other three receive it. My sprites all started at one, but then counted in unison by three at a time (1, 4, 7). I tried broadcasting three different orders so each sprite would receive their own, but that didn't change anything. I tried delaying each one by just a hair, but that just caused them to count in a line (first sprite said 1, second said 2, and so on). I tried having them count by .333 instead of by 1, and that almost worked, except all the numbers were animated as 2.00, 3.00, etc. Not exactly natural. Now I'm at a loss. Any ideas?

(Note: when I click the command individually in each sprite's code, it works perfectly. It just won't work when they're all counting together.)

Thanks!
sonicfan12p
Scratcher
1000+ posts

Making sprites count in unison

For future reference, if you would like help with a script, it's usually very helpful to share a link to your project.

However, this problem seems simple enough. Let me guess, all three sprites have a script that looks something like this?

when I receive [count v]
set [number v] to [0]
repeat (10)
change [number v] by (1)
say (number) for (1) secs
end

If that's the case, then what's happening is all 3 sprites receive it at the same time, and all of them add 1 to your number variable at the same time, making it look like it's going up by 3.

Is all of that accurate, or is your script different?

Inactive account. Please direct all questions to my secretary.
amazethisrabble
New to Scratch
3 posts

Making sprites count in unison

Sorry! First time posting. I just started last night.

https://scratch.mit.edu/projects/207944873/

And it's identical except I have “set number to 1”.
asivi
Scratcher
1000+ posts

Making sprites count in unison

You should programm it so that only one character increases the counter. Remixed.

Last edited by asivi (March 7, 2018 06:25:26)

amazethisrabble
New to Scratch
3 posts

Making sprites count in unison

Thanks!

Powered by DjangoBB

Standard | Mobile