quiz image

C & R Sections 7.3 and 7.4 Scratch

LovedHyperbola avatar
LovedHyperbola
·
·
Download

Start Quiz

Study Flashcards

10 Questions

Why is it a good idea to make a script repeatable?

To ensure the script behaves consistently every time it's run.

What happens when you drag a sprite to a new position on the stage?

Its x, y value changes.

What is the purpose of a 'go to' statement in a script?

To set a sprite's position to a specific x, y value.

Why might a sprite disappear from the stage?

Because it moves off the stage due to too many repeats or big move steps.

What is one way to retrieve a sprite that has disappeared off the stage?

By using a 'go to' block.

What is the purpose of an 'if on edge' block in a script?

To make a sprite bounce back from the edge of the stage.

Why does a sprite turn upside down when it bounces back from the edge of the stage?

Because of the way it was programmed to bounce back.

What should you ensure when making a script repeatable?

That the sprite starts at the same position every time.

What happens when you add a 'go to' statement to a script?

The sprite sets its position to a specific x, y value.

Why is it important to check if a sprite is on the edge of the stage?

To prevent it from moving off the stage.

Study Notes

Script Repeatability

  • To make a script repeatable, ensure the sprite starts in the same spot every time the green flag is clicked.
  • Avoid starting the sprite in a position dependent on its previous location.
  • If needed, make the starting position deliberately random.

Using the "Go to" Statement

  • To set the sprite's starting position, use the "go to" statement from the Motion tab.
  • The "go to" statement uses the current x, y value of the sprite.
  • Drag the sprite to the desired position, and then add the "go to" block to the script.
  • Connect the "go to" block to the "when green flag is clicked" block.

Moving Off the Screen

  • Be cautious when using repeat or big move steps, as the sprite might disappear off the stage.
  • To retrieve a lost sprite, use the "go to" block.
  • Alternatively, add an "if on edge" block to the repeat block to make the sprite bounce back.

Fixing Sprite Rotation

  • To prevent the sprite from turning upside down when bouncing, add a "set rotation style" block.
  • This block helps maintain the sprite's direction and orientation.
  • Use the "point in direction" block to change the sprite's direction, and adjust the degrees to set the angle and facing direction.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser