Scratch Lab 2

Name: Shreya Raj

Period: 7

Assignment: Lab #2

Lab 2 Overview

This lab problem focused on being able to figure out how to create costumes, understanding loops, and figuing out some new animation commands. By being able to create costumes for your sprite, you were then asked to animate your sprite with the different costume created. There were also differnet problems as to figuring out loops. If it was best to use the loop repeat or forever. Also, some problems were given to help the scratch user to rerally understand the commands and the actions given in scratch. Complete instructions of the lab is found HERE.

My Solution Problem Number 1

This problem had to do with creating costumes and animation. You were told to create your own sprite (with different costumes) and then to simply animate the sprite. My solution involved choosing costume1 then setting my sprite to go to x:36 y:-66. Then I used my glide comand for one second with a specific x and y coordinate to make my sprite glide diagonally. After that glide I switched to costume2 and then using a glide command, costume2 runs horizontally. My final commands involved switching to costume3 and then using the glide command I animated my sprite to move downward diagonally.

My Project Link

My Solution Problem Number 3

In this problem you were asked to figue out the right code that would make your sprite move 100 steps. You were given 5 different options as to a solution, and my solution involved only 2 commands. The first command was the move 10 steps command and the I used the repeat command. I programmed the repeat command to repeat the 10 steps 10 times. To start the animation I also had to add the start when flag clicked command.

My Project Link

My Solution Problem Number 5

In this problem you were asked to choose the right code (out of 3 options) to make any sprite say "There's a mouse in my house," whenever the mouse touched the sprite. Out of all the options, my solution involved the conditional, if touching mouse-pointer then say There's a mouse in my house for 0.5 seconds. With that I added a forever loop over the condtional to make the sprite speak any time the mouse touched the sprite.

My Project Link

Questions

  1. What are the type of loops contained in Scratch? What are the differnces?
      Different types of loops on Scratch are the repeat command, the repeat until command, and the forever command. The main differnce between these loops is that the repeat command has a restriction toward the command you would like to repeat. For example if you wanted to repeat walking once into 10 times. The restriction on the repeat command is the 10. Where as the forever loop would just make the sprite walk one step forever.
  2. If you are given a situation where you want to repeat but don't know how long it should repeat for, which loop is the best structure to use?
      The best loop to use is the forever loop, this is because if you have no specific suggestion as to how long you want the command to repeat, then you would just have to use the forever loop.
  3. Does the following stucture work? Does it make sense? Why or why not?
      This code does not make sense because the first forever loop goes back to the forever loop inside the first forever loop. It does not start from the begenning like you would want it to.
  4. How does a sprite know when to begin an action? Is there more than one way?
      One way the sprite knows how to begin is by the start when green flag is clicked command. There are other ways to make your sprite know to begin, for example "when the spacebar is clicked" command.
  5. Are the following code snippets equivalent? Why or why not?
      The following codes are the same, they are saying the same things just in reverse.
  6. Click HERE to return to homepage.