ScratchData LogoScratchData
Back to Tutor-42's profile

Scratch Can Count 2 - if you are lucky!

TUTutor-42•Created August 24, 2019
Scratch Can Count 2 - if you are lucky!
0
0
5 views
View on Scratch

Instructions

Problems with two "when Green Flag clicked" scripts. A six line project that counts to 3 and plays a musical note three times. * What could possibly go wrong? * Green Flag to run the project. Green Flag to run the project again! The project always works, but it is a fluke! Here is a project with identical code that doesn't work at all! It plays 4 notes or none at all. https://scratch.mit.edu/projects/323749687/ This version of the program always works because the top "when Green Flag clicked" script always runs before the bottom script when we click the Green Flag. The top script is not run first because of its position in the editor. You can drag the two scripts up, down, left or right or put them on top of each other. The top script will still run first. In the other version of this project, the bottom "when Green Flag clicked" script always runs before the top script when we click the Green Flag.

Description

https://scratch.mit.edu/discuss/post/3680365/ ** See this tutorial which explains the following topics and more: - why two "when Green Flag scripts" in a project may cause problems (ie. how two "identical" projects run differently because their scripts run in a different order) * how to write projects to fix these problems - why some projects say "Click the Green Flag twice" - how this project works in detail including how scripts pause and yield to allow other scripts to run - how Scratch decides the order to run scripts

Project Details

Project ID325392505
CreatedAugust 24, 2019
Last ModifiedAugust 24, 2019
SharedAugust 24, 2019
Visibilityvisible
CommentsAllowed