Discuss Scratch

16liangk
Scratcher
15 posts

how to get a sprite do two things at once

I need a sprite doing simoultaneous things
Lilifant7253
Scratcher
1000+ posts

how to get a sprite do two things at once

Just make more scripts for one sprite I think.
This belongs to help with scripts I think. I reported it.
scratchisthebest
Scratcher
1000+ posts

how to get a sprite do two things at once

First, ask yourself “Do I really need just 1 sprite to do this?” Having two sprites might be a better idea.

if not, try this!

when gf clicked
broadcast [thing1 v]
broadcast [thing2 v]

when i receive [thing1 v]
move (10) steps //do stuff

when i receive [thing2 v]
say [Hello!] //or whatever

here's Lilifant's idea, which is simpler (but you don't learn how to use broadcasts )
when gf clicked
move (10) steps //do stuff

when gf clicked
say [Hello!] //or whatever
FalconGunner99
Scratcher
1000+ posts

how to get a sprite do two things at once

scratchisthebest wrote:

First, ask yourself “Do I really need just 1 sprite to do this?” Having two sprites might be a better idea.

if not, try this!

when gf clicked
broadcast [thing1 v]
broadcast [thing2 v]

when i receive [thing1 v]
move (10) steps //do stuff

when i receive [thing2 v]
say [Hello!] //or whatever

here's Lilifant's idea, which is simpler (but you don't learn how to use broadcasts )
when gf clicked
move (10) steps //do stuff

when gf clicked
say [Hello!] //or whatever
It's good to learn about broadcasts, but I rarely use them anymore because they tend to lag when being used a lot. Really, having multiple green flag scripts would be better in the long run.
firedrake969_test
Scratcher
500+ posts

how to get a sprite do two things at once

Multiple green flag scripts, some variables, possibly a list, a forever loop, and an if loop. Of course, that's me being complicated.
I_LIKE_YO_SCRATCH
Scratcher
26 posts

how to get a sprite do two things at once

16liangk wrote:

I need a sprite doing simoultaneous things
Are you talking about those projects with one sprite but it lookks like two? I know that thing.
when green flag clicked
set [clone number v] to [0]
repeat (your number)

change [clone number v] by (1)
create clone of [myself v]
end

when I start as a clone
if <(clone number) = [1]> then
...
end

when I start as a clone
if <(clone number) = [2]> then
...
end
HipsterRabbit
Scratcher
62 posts

how to get a sprite do two things at once

when green flag clicked
stamp

when green flag clicked
set [ v] to [ ]
just do multiple ‘when green flag is clicked’ or whatever else, blocks.
tristanvice
Scratcher
10 posts

how to get a sprite do two things at once

I_LIKE_YO_SCRATCH wrote:

16liangk wrote:

I need a sprite doing simoultaneous things
Are you talking about those projects with one sprite but it lookks like two? I know that thing.
when green flag clicked
set [clone number v] to [0]
repeat (your number)

change [clone number v] by (1)
create clone of [myself v]
end

when I start as a clone
if <(clone number) = [1]> then
...
end

when I start as a clone
if <(clone number) = [2]> then
...
end
wuts teh culler meenin 4 teh grey blox?
tristanvice
Scratcher
10 posts

how to get a sprite do two things at once

when green flag clicked
say [hi!] for (2) secs
think [uhh...] for (2) secs

switch costume to []
wait (2) secs
switch costume to []
[scratchblocks]

when green flag clicked
[/scratchblocks]
brainstorm101
Scratcher
1000+ posts

how to get a sprite do two things at once

16liangk wrote:

I need a sprite doing simoultaneous things
Two scripts that start at the same time:
when green flag clicked
move (10) steps
when green flag clicked
change [color] effect by (25)
Programmenz
Scratcher
9 posts

how to get a sprite do two things at once

Maybe this can help!

when green flag clicked
broadcast [First thing to do! v]
broadcast [ Second thing to do! v]


when I receive [First thing to do! v]
Do whatever and stuff!


when I receive [Second thing to do! v]
DO whatever but different than the first one or something :D

HOPE THIS HELPED YOU!!!

Oh wait, caps lock.
XavierBtm
New Scratcher
10 posts

how to get a sprite do two things at once

or11robes
Scratcher
1 post

how to get a sprite do two things at once

FalconGunner99 wrote:

scratchisthebest wrote:

First, ask yourself “Do I really need just 1 sprite to do this?” Having two sprites might be a better idea.

if not, try this!

when gf clicked
broadcast [thing1 v]
broadcast [thing2 v]

when i receive [thing1 v]
move (10) steps //do stuff

when i receive [thing2 v]
say [Hello!] //or whatever

here's Lilifant's idea, which is simpler (but you don't learn how to use broadcasts )
when gf clicked
move (10) steps //do stuff

when gf clicked
say [Hello!] //or whatever
It's good to learn about broadcasts, but I rarely use them anymore because they tend to lag when being used a lot. Really, having multiple green flag scripts would be better in the long run.


hi ive got my code but i have done this but i need it to do 1 of them like if someone said yes i need it to do yes but just now it is doing both things
Indigo92710
Scratcher
4 posts

how to get a sprite do two things at once

I don't understand. I'm trying to figure it out, but it's not working!
NormalMaker
Scratcher
500+ posts

how to get a sprite do two things at once

Indigo92710 wrote:

I don't understand. I'm trying to figure it out, but it's not working!
Please do not necropost.
SatroCube
Scratcher
6 posts

how to get a sprite do two things at once

q

Last edited by SatroCube (July 15, 2023 15:00:17)

HogwartsTeacherSnape
Scratcher
100+ posts

how to get a sprite do two things at once

SatroCube wrote:

q
Please don't spam

Powered by DjangoBB