1, 2, 3, code ! - Cycle 3 activities - Step 2.2. Customizing the environment and saving all work

Summary

The students learn to customize Scratch (sprite and backdrop) and save their work to be used again later.

They discuss the different steps they will follow to create their video game.

Key ideas
(see Conceptual scenario)

“Machines”

  • The machines around us merely execute orders (instructions).
  • By combining basic instructions, we can make them execute complex tasks.

“Algorithms”

  • An algorithm is a method used to resolve a problem.
  • A loop allows the same action to be repeated multiple times.
  • Certain loops, known as “infinite loops,” never stop.
  • Certain loops, known as “iterative loops,” are repeated a predefined number of times.

“Languages”

  • To give machines instructions, we use a programming language, which can be understood by both machines and people.
  • Scratch is a graphical programming environment that uses a simple language.
  • A program is the expression of an algorithm in a programming language.
  • Certain instructions are only executed when an event is triggered. This is known as event-driven programming.
  • Certain instructions are executed one after the other. This is known as sequential programming.
  • The execution of a program is reproducible (if neither the instructions nor the data to manipulate change, the program always gives the same result).

Equipment

For the class

  • Projector
  • Enlarged version (A3 or A4) of Handout 1

For each pair of students

  • A computer with Internet access or, if there is no good connection available, a computer with Scratch preinstalled.

For each student

Teaching notes:

  • The purpose of this teaching guide is to teach Computer Science (more specifically programming, here). We will not, therefore, describe possible extension activities such as those that can be done in art or ICT class to design a personalized rover or backdrop for our video game. In this step, we propose simply to import components that we provide for classes. That has two benefits: it saves time and generates a degree of consistency between the students’ programs, making it easier to compare them.
  • Of course, the teacher can decide to spend an hour in class with the students designing these items. In this case, you need to be careful about the backdrop: it has to be relatively uniform, as decorative elements (obstacles and resources) will be added later in the form of other sprites.

 

 Activity 1: Changing the sprite (5 minutes)

The teacher explains that it is possible to get rid of the “cat” sprite and create another in its place that fits in better with our space mission project: a rover.

  • To delete the cat, right-click on its icon in the sprites area and select “delete.”

  • There are four different ways to create a new sprite, which are accessible from the “new sprite” toolbar, to the bottom right of the stage (the method we recommend here is described in bold).

  • Choose sprite from library

    Scratch comes with a library of about 100 predefined sprites. These sprites can be practical for students’ projects, but have very mixed styles.

    Paint new sprite

    Scratch has an integrated drawing tool that students can use to create their own rover “by hand.”

    Upload sprite from file

    This is the option we recommend here, as the aim of this project is not to teach drawing on the computer, but to teach programming.

    We recommend teachers provide the files required for the project (in this case, the rover) in a folder that is easily accessible for the students. All the required files are available on the project website, see page XX.

    There are two options for the rover: a “square” rover and a more elongated one. We will be using the latter in the screenshots.

    New sprite from camera

    This can be a very practical tool for personal projects (you can add your own face as a new sprite), but it isn’t useful for this project.

Teaching note:

We have noticed that there can be problems importing the sprite from a file on certain computers. If the import fails, there is a very simple way to fix the problem: save all ongoing work, close Scratch, reopen Scratch, and try importing again. After that little workaround, it works!

 

 Activity 2: Changing the backdrop (5 minutes)

Similarly to above, it is possible to change the stage’s backdrop, using an image from the library or an image from a file provided by the use, or by painting a backdrop yourself.

We recommend choosing the option “Upload backdrop from file,” selecting the file martian_soil.png (from the “Stages” folder in the files provided). Here is a preview of the rover, on the chosen backdrop.

 

 

 Activity 3: Saving your Scratch program (5 minutes)

The teacher explains that the current program has to be saved (even if there isn’t yet much in there) to avoid having to redo everything during the next step.

Option 1: Scratch installed locally Option 2: Scratch used online

Save by opening the “file” menu and then on the option “save.” Then browse to the folder used for the project and class (once again, we strongly recommend a Desktop shortcut) and choose a filename.

This filename could, for example, contain the students’ names, so that they can easily find their own programs later.

Import by either double-clicking on the saved file (which opens Scratch) or by opening Scratch and then clicking on “file” and the option “open.”

Save by opening the “file” menu and then on the option “Download to your computer.”

You can import your file later from the same menu by clicking on the option “Upload from your computer.”

 

Review and conclusion

The class goes over what it has learned to do in Scratch: importing sprites and backdrops, and saving and resuming work.

The teacher can show the demonstration of the “final” game again, so as to help the students visualize the activities they still need to complete. For example:

  • Driving the rover using arrow keys
  • Importing other sprites as resources and obstacles
  • Making the player win points for collecting resources, and lose lives when they hit obstacles
  • Making resources disappear once they are collected and reappear elsewhere on the screen (at a random position)
  • Make a tornado move randomly around the stage
  • Make the game end when the player has no lives left (with the text “Game Over” that appears, and all the rest disappearing).

Other activities are also possible:

  • Adding a countdown to spice up the game (collect as many resources as possible in a given time)
  • Personalize the game by painting your own sprites and backdrop
  • Etc.

These steps will be looked at again later, and broken down into basic tasks where necessary. Each pair can move forward at their own pace, as the main thing is to have a playable game at the end of the project.

 

 


<< Step 2.1 Sequence II Step 2.3 >>

 

Project partners

Aucun résultats