Discuss Scratch

mrhopefong
Teacher
14 posts

Running 2 separate and synchronous forever loop with IF condition but Scratch will only trigger one instead of both

Hi all,

For some reason, if I have 2 separate forever loop + IF condition, it appeared Scratch will only trigger one of that.
To better illustrate the problem, I have recorded a video:
Your text to link here…

Or image of the issue
Your text to link here…

I would expect when the sprite touches the apple, it pops up with Hello speaking cloud AND also produce a sound.
But for some reason it only pops the hello speaking cloud but no sound..

I understand I may be able to just combine them into one which will work but I wanted the speaking cloud and sound to run at the same time instead of one after the other.

Hope anyone who has experienced the same give some insights , thanks!

Regards,
Mr Hope
mrhopefong
Teacher
14 posts

Running 2 separate and synchronous forever loop with IF condition but Scratch will only trigger one instead of both

mrhopefong wrote:

Hi all,

For some reason, if I have 2 separate forever loop + IF condition, it appeared Scratch will only trigger one of that.
To better illustrate the problem, I have recorded a video:
Your text to link here…

Or image of the issue
Your text to link here…

I would expect when the sprite touches the apple, it pops up with Hello speaking cloud AND also produce a sound.
But for some reason it only pops the hello speaking cloud but no sound..

I understand I may be able to just combine them into one which will work but I wanted the speaking cloud and sound to run at the same time instead of one after the other.

Hope anyone who has experienced the same give some insights , thanks!

Regards,
Mr Hope



sorry guys, please ignore…I figured out the 2nd IF loop has got the wrong condition….
hi875230163394
Scratcher
1000+ posts

Running 2 separate and synchronous forever loop with IF condition but Scratch will only trigger one instead of both

If touching edge refers to if the sprite is touching the edge of the screen, yoh can fix this problem by changing the “touching edge” block to a “touching apple” block.

Hope this helps!

P.S: next time you have a problem relating to code, use the help with scripts forum instead.
mrhopefong
Teacher
14 posts

Running 2 separate and synchronous forever loop with IF condition but Scratch will only trigger one instead of both

hi875230163394 wrote:

If touching edge refers to if the sprite is touching the edge of the screen, yoh can fix this problem by changing the “touching edge” block to a “touching apple” block.

Hope this helps!

P.S: next time you have a problem relating to code, use the help with scripts forum instead.

hi875230163394 wrote:

If touching edge refers to if the sprite is touching the edge of the screen, yoh can fix this problem by changing the “touching edge” block to a “touching apple” block.

Hope this helps!

P.S: next time you have a problem relating to code, use the help with scripts forum instead.

Thanks for the tips! Apology for posting in the wrong place and thanks for the friendly reminder.

What you pointed out that seemed to solved it, however it does not seem to work in this project. Pretty much similar code
Your text to link here…

Your text to link here…

hi875230163394
Scratcher
1000+ posts

Running 2 separate and synchronous forever loop with IF condition but Scratch will only trigger one instead of both

mrhopefong wrote:

hi875230163394 wrote:

If touching edge refers to if the sprite is touching the edge of the screen, yoh can fix this problem by changing the “touching edge” block to a “touching apple” block.

Hope this helps!

P.S: next time you have a problem relating to code, use the help with scripts forum instead.

hi875230163394 wrote:

If touching edge refers to if the sprite is touching the edge of the screen, yoh can fix this problem by changing the “touching edge” block to a “touching apple” block.

Hope this helps!

P.S: next time you have a problem relating to code, use the help with scripts forum instead.

Thanks for the tips! Apology for posting in the wrong place and thanks for the friendly reminder.

What you pointed out that seemed to solved it, however it does not seem to work in this project. Pretty much similar code
Your text to link here…

Your text to link here…

The code appears to be fully functional on my end, maybe there is something happening on your end?
mrhopefong
Teacher
14 posts

Running 2 separate and synchronous forever loop with IF condition but Scratch will only trigger one instead of both

hi875230163394 wrote:

mrhopefong wrote:

hi875230163394 wrote:

If touching edge refers to if the sprite is touching the edge of the screen, yoh can fix this problem by changing the “touching edge” block to a “touching apple” block.

Hope this helps!

P.S: next time you have a problem relating to code, use the help with scripts forum instead.

hi875230163394 wrote:

If touching edge refers to if the sprite is touching the edge of the screen, yoh can fix this problem by changing the “touching edge” block to a “touching apple” block.

Hope this helps!

P.S: next time you have a problem relating to code, use the help with scripts forum instead.

Thanks for the tips! Apology for posting in the wrong place and thanks for the friendly reminder.

What you pointed out that seemed to solved it, however it does not seem to work in this project. Pretty much similar code
Your text to link here…

Your text to link here…

The code appears to be fully functional on my end, maybe there is something happening on your end?
Hmmm, strange. Thanks friend. I will recreate and test again.

Powered by DjangoBB