ScratchLab4

Scratch Lab #4

Lab Overview

This lab required us to use variables to create effects such as speeding up movements and storing information to be repeated back. My projects are HERE HERE and HERE

My Solution

My solution to the first problem was to create a sprite that switched costumes inside a forever loop while the time between costumed changes was increased or decreased depending on the variable speed. The speed variable was controlled by two sprites, one that said faster and one that said slower. My solution to the second problem was to create a sprite that asks the user questions, then stores the answers as variable to be repeated back to a sprite that appears when the conversation ends. I used different varibles for every answer, then had the sprite say those variables in the next conversation. My solution to the third problem was to create a sprite that asks the user for four coordinates and sets the answers as variables. Those variables are then plugged into the distance formula (made using operator blocks) to create the distance variable that describes the distance between the two points.

Questions

  1. Variables in computer programming are different because you know what they are, unlike in math.
  2. When creating a variable, it can either apply to one sprite or all sprites in the script.
  3. A variable can only store one value at a time.
  4. It will not work because it would have two of the same values at the same time.
  5. This will flip the values and will work because there is a temp block.

Click HERE to return to homepage