Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Teach the concept of a variable’s scope in Scratch by explaining the difference between “For this sprite only” and “For all sprites.”

Share Teach the concept of a variable’s scope in Scratch by explaining the difference between “For this sprite only” and “For all sprites.” with FacebookShare Teach the concept of a variable’s scope in Scratch by explaining the difference between “For this sprite only” and “For all sprites.” with Twitter
  • Scope works a little differently in Scratch than in other languages. A variable that is "For this sprite only" can still be read by other sprites, but only the sprite that owns it can write to it. Variables that exist "For all sprites" act like global variables. This can help students when deciding what scope of variables to use for different tasks.

More about this tip

Tags

  • Scratch
  • Intro Programming
  • Algorithms and Design
  • Programming Concepts
External Source

Learn to Program with Scratch by Majed Marji

Other Tips By
Other Tips By Majed Marji

Similar tips

Misconception: Students think that both the IF and the ELSE cases of a conditional are executed every single time a conditional runs.
Misconception: With conditionals, students may try to compare the memory address of a function to a number, like x < foo, when they intended to compare x with the return value of foo.
Use the "'build your own block'" feature in Scratch 2.0 to teach "bottom-up" or "top-down" processes for breaking up problems.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College