Zmiany

Skocz do: nawigacji, wyszukiwania

Module 1 - Getting started in Scratch

Dodane 11 095 bajtów, 19:00, 7 lip 2015
[[Plik:C13.png|center]]
 
 
 
[[Plik:C13.png|center]]
 
 
 
[[Plik:C14.png|center]]
 
 
Task: We ask the students to find a block which can clear the stage.
 
 
[[Plik:C14_001.png|center]]
 
 
Once the '''clear''' block is found, we ask the students to click it. We explain that this is how we can test the function of a selected block – see its function without having to insert it into the script.
Using this new block the students are to create another script for clearing the stage by pressing the '''C key'''.
 
 
[[Plik:C15.png|center]]
 
 
''Then we ask all the students to set their character, facing right, in the top left corner of the stage.
Students can do this in many ways – by pressing the down arrow until the sprite is facing right and then dragging it with the mouse to the correct specific place. They can also find and use the set '''the direction to 90''' block. They do not need to insert it into the script – it’s enough just to click it. If necessary, we demonstrate how to do this. We also show them how to reduce the size of the sprite (so that the drawing it creates can be seen better).''
 
 
[[Plik:C16.png|center]]
 
 
We ask the students to set to 100 the number of steps by which the character will move when the '''right arrow key''' is pressed. Then we tell them to try and control the sprite’s movement in a way that will allow them to draw a square. We ask an additional question: How many times (by what angle) the sprite needs to be rotated after one side of the square is drawn?
''Students should note that they need to make 6 turns, i.e. rotate the sprite by a total of 90 degrees.''
We invite a student to show the solution on the interactive whiteboard and we discuss it with the group. Then we ask the students to change the rotation value for the script (block) when the down arrow key is pressed to 90 and test the programme again. We change the value on the board.
''We conclude that now the sprite needs four changes for a full rotation. This allows us to determine that the character will move only right, down, left and up, provided that the initial movement was in one of these directions (which is why we asked for this particular initial setting of the sprite).''
 
'''Task:''' We ask the students to save their programme as '''First Programme'''.
Then we ask them to select '''New''' from the '''File''' menu to create a new programme.
 
 
===Modify the costume and animate the sprite ===
Time to complete this part: about 20 minutes
'''
 
We ask the following question:''' Does the sprite always have to be a kitten and wouldn’t it be fun if we could change it in any way we want? We ask whether the students can see an option on the screen they think could be used to effect such a change.
''Students should see that in the centre of the screen there are several tabs, among them Costumes. When we open it, we can change the sprite’s costumes.''
'''Task:''' We ask the students to try to draw a new costume, import a ready costume from the Scratch costume gallery and remove unnecessary costumes.
 
[[Plik:C17.png|center]]
 
 
[[Plik:C18.png|center]]
 
 
'''Task:''' Then we ask the students to import a car costume and draw a blue police light beacon on it. Then ask them to copy the modified sprite and change the beacon colour to red in the other costume.
 
 
[[Plik:C11.png|center]]
 
 
[[Plik:C19.png|center]]
 
 
'''Task:''' We want the car roof beacon to flash when the programme is started. We ask the students to find a block which can be used to switch between costumes.
''Students should find a few blocks. We tell them to click each of them several times and check what happens to the sprite on the stage.''
 
[[Plik:C19_001.png|center]]
 
''Students should see that by clicking on the '''next costume''' block they switch between a red and blue coloured beacon. We can explain that this way they can animate the picture by changing sprite costumes.''
 
 
 
[[Plik:C20.png|center]]
 
 
We ask the students to drag the '''next costume''' block to the script area and start the programme using the green flag.
'''We ask the following question:''' Has anything happened? What is missing?
''No. The green flag block is missing.''
'''Task:''' We ask the students to add the green flag block and then click on it a few times and check the result.
''The beacon colour changes each time only once, when the programme is started.''
'''We ask the following question:''' What is missing that would allow the costume to alternate between the blue and red beacon after the programme is started?
''Students will have various ideas, e.g. add multiple '''change costume''' blocks. If necessary, we prompt them that we want to keep the costume changing all the time when the programme is running, that is, each time we press the green flag.''
We ask the students to find the appropriate block – we can hint that it is probably located in the Control group.
''Students may offer various suggestions. We discuss the ideas submitted in order to finally select the '''always''' block.''
 
 
 
[[Plik:C21.png|center]]
 
 
''We ask them how it should be included in the script. If necessary, we suggest that whatever is always to happen should be inserted inside the block.''
 
'''Task:''' We ask the students to modify and start the programme.
'''We ask the following question:''' Can we see the car roof beacon flashing?
''The flashing effect is not well visible, because the costume changes very quickly.''
 
 
'''We ask the following question:''' Is there a control block which can cause the costume to alternate more slowly?
''If necessary, we prompt the students that between changes the sprite should wait, and so the '''wait''' block should be inserted in the right place.''
 
 
[[Plik:C23.png|center]]
 
 
'''''We ask the following question:''' Now can we see the car roof beacon flashing?
Students will come to the conclusion that the changes can be seen, but they are too slow. We can suggest how to modify the waiting time by setting it to e.g. half a second instead of one second. Some students may not notice the change because they will have inserted the wait block outside the '''always''' loop. In such a case we need to discuss with all the students why the wait block should be inserted there – so that always after changing the costume the sprite waits for a specified time.''
 
 
[[Plik:C22.png|center]]
 
 
 
'''Task:''' We ask the students to save the programme as Second Programme.
 
 
 
===Drawing a square ===
Time to complete this part: about 25 minutes
 
We remind the students that the computer runs according to a specific set of rules provided by man.
We ask the following question: Can anyone name a rule they have come across while playing or at a lesson or at school (e.g. maths)?
''We suggest for example the instructions for using Lego blocks or building a model airplane, describing step by step which blocks (components) and in what order should be used (glued) to build a specific model. We can ask the students whether they have already learned to add integers in writing. We ask a volunteer to write on the board the rules for adding two three-digit numbers. Example:
1. ''write the first number on a sheet of paper;''
 
2. ''write the second number under the first, aligning it to the right, so that the single digit is under the single digit of the first number, proceed similarly with the tens and hundreds digits;''
 
3. ''draw a line under the second number;''
 
4. ''add the single digits, write the last digit of the result under the line in the single digit column; if the result is double-digit, write the one (carried forward) in the tens column above the first number;''
 
5. ''add the digits in the second column (tens) in the same way as in the case of single digits; write any digit carried forward in the hundreds column;''
 
6. ''add the hundreds digits; write any digit carried forward before the hundreds digit of the result. Note that a strict rule for adding two three-digit integers has just been written down. We can say that such a rule is called an algorithm.''
 
 
We suggest to consider together a rule (algorithm) for drawing a square by the sprite.
'''We ask the following question:''' What subsequent steps need to be taken so that a square is drawn? In other words, what is the rule (algorithm) for drawing a square? We write it on the board, for example:
 
''Correct answer we aim at by guiding the students:''
* ''apply the pen (if it is raised – to make sure that it is applied)''
* ''move by 100 steps''
* ''rotate the sprite by 90 degrees''
* ''move by 100 steps''
* ''rotate the sprite by 90 degrees''
* ''move by 100 steps''
* ''rotate the sprite by 90 degrees''
* ''move by 100 steps''
* ''rotate the sprite by 90 degrees''
 
 
[[Plik:C25.png|center]]
 
 
'''We ask the following question:''' Which commands are repeated?
* move by 100 steps
* rotate the sprite by 90 degrees
I.e. drawing a single side of a square.
 
'''We ask the following question:''' How many times are these steps repeated?
* four
* A square has four sides.
'''Task:''' We ask the students to find a block which can be used to repeat an operation for a specified number of times.
''Students should find the '''repeat <10> times''' block.''
 
 
[[Plik:C26.png|center]]
 
 
'''Task:''' We ask students to try to create a script which draws a square when the K key is pressed (the students can write subsequent steps on the board):
* ''apply the pen''
* ''repeat two operations four times''
* ''move by 100 steps''
* ''rotate the character by 90 degrees''
* ''raise the pen (or – we discuss this with students, if needed, and determine what state we want to achieve)''
* ''finish the task''
 
 
We give students a few minutes to build the script. We walk around the room and, if necessary, provide suggestions on how to solve the problem. After they finish we ask them to save the programme as '''Square''' using the '''File -> Save As'''.... menu path.
 
 
 
[[Plik:C27.png|center]]
 
 
===Additional tasks ===
'''Additional task for self-completion:''' We suggest that the students change the colour of the pen and its thickness, and re-test the programme. We do not suggest which blocks they should use and where. Finally, we check the solutions and present selected ones on the board. After the students finish the exercise we ask them to save their programme as '''Square2''' using the '''File -> Save As'''.... menu path.
 
 
[[Plik:C29.png|center]]
 
 
'''Additional task for self-completion:''' We ask the students to return to the programme saves as '''First Programme''' and modify it. Instead of rotating the kitten using the '''down arrow''' key, we define scripts running when the following keys are pressed:
* '''up arrow''' to set the sprite upwards and move 20 steps
* '''down arrow''' to set the sprite downwards and move 20 steps
* '''right arrow''' to set the sprite to the right and move 20 steps
* '''left arrow''' to set the sprite to the left and move 20 steps
They students should save the modified programme as '''Third Programme'''.
181
edycji