Zmiany

Skocz do: nawigacji, wyszukiwania
''At the beginning of the lesson we remind students what they were supposed to prepare between classes. We invite a volunteer to present his/her solution. We ask if anyone had a different way of finding a solution. We discuss the solutions (praising correct solutions to individual tasks).''
''If there was no homework, we start by repeating key issues from the previous module. We also ask if students have any doubts regarding their own projects. If anyone wants to show something he/she is proud of, we let him/her do it.'' 
===Designing a programme that simulates sprite races===
'''We ask the following question:'''Where should we start designing our programme from? What should we include in it?
''The answers may vary, including many correct ones. We will, therefore, seek to ensure to initially determine all the important elements of the programme, including:''
* ''* where sprites will start from (we need to determine their position, because they should always start from the same positions), and where the finish line will be located,'' 
[[Plik:A21.png|center]]
 
 
[[Plik:A11.jpg|center]]
 
 
* ''which way they will move – to the right, to the left, and maybe up or down''
** ''selecting the direction from left to right seems natural, because this is in accordance with the direction of reading, and has the advantage of sprites being able to travel a longer distance,''
 
* ''how to determine the running speed of individual sprites so that each time the programme is started each sprite has a chance to win,''
** ''e.g. sprites can move by a random, small (e.g. between 1 and 5) number of steps, and such a random selection should take place before each sprite moves on the board – until one of them crosses the finish line,''
 
 
[[Plik:A13.jpg|center]]
 
* ''how a sprite will recognise that it has reached the finish line (crossed the line),''
** ''it can check after each movement (shift) by a randomly selected number of steps whether it has gone over the finishing position. If so, it has reached the finish line,''
* ''how a sprite will know that it is the first,''
** ''e.g. when it reaches the line it can check if the position of the other sprite is smaller or bigger than the position of the finish line. If it is smaller, this means that it has arrived first and can say “I won!”.If it is not smaller, this means that the other sprite arrived there earlier and won or there is a draw.''
 
 
 
[[Plik:A14.jpg|center]]
 
 
[[Plik:A15.png|center]]
 
 
===Implementation of the programme by the students===
'''Time to complete this part: about 30 minutes'''
 
'''Task:''' We ask the students to start implementing the programme in accordance with the agreements made (common ones or according to the students’ own ideas, if in the second part we assumed that each student invents his/her own algorithm, and we only suggest what it should include).
 
''It is up to the students to choose the characters (costumes) of individual sprites and the setting in which the race will take place. We only point out that sprites should differ in appearance, e.g. if we leave cats, we can change one’s colour.
When performing the task we help in solving any possible problems that the students may encounter. We try not to impose our own solutions, but rather let them independently analyse where a problem has occurred, why and how to fix it – assisting only with hints and directing by asking questions.''
 
Below are sample scripts for racing sprites (for the purpose of the project named Bolek and Lolek).
 
 
 
[[Plik:A16.jpg|center]]
 
 
===Introducing extensions to the programme===
'''Time to complete this part: about 30 minutes'''
 
'''The first task''' may be intended for those students who are quickest to finish the basic version of the programme, and consists in adding animation to a sprite character. If the sprite is a kitten or another animal or a fairytale character, it could move its legs. In the case of model cars, the wheels could turn, there could be a light beacon on the roof, or another idea a student comes up with. The important thing in this task is that the animation begins at the starting line and end as soon as the finish line is crossed when a sprite ends the race.
 
Hint – animation should be a separate script for each sprite, and could be similar to the following example.
 
 
[[Plik:A17.jpg|center]]
 
'''The second task''' is to add a timer. During nearly every televised race we can see the preview of the time in which each competitor reaches the finish line. We would like our programme to similarly display the time. We discuss with the students how we can implement this. We ask them to find time measurement blocks.
 
''Certainly the '''timer''' and '''reset''' '''clock'''blocks will be useful.''
 
[[Plik:A18.jpg|center]]
''
We should consider where and how to use them. The clock should be cleared at the start of the race, and the measurement made during and at the end of each sprite’s sprint.''
 
Then we discuss how we could use them. How to record the time and how to display it on the screen.
 
''One method is storing time after each movement of each sprite until it reaches the finish line. Then we can display variables in which sprites store their times and we will have a live preview – just like in a televised race.Simultaneously, the last time stored in the variable is the time when a sprite has reached the finish line. The “clock” will stop automatically.We point out that we need to create a variable, e.g. called '''time''', separately for each sprite (available only for a particular sprite, and not all of them).''
 
We ask the students to make appropriate modifications to the programme and test it.We invite the first student who manages to achieve this to explain how he/she has done it and present his/her solution on the board. Then we ask if anyone had a different way of doing this and also discuss it with the whole group.
A sample programme modification may look like this:
 
 
[[Plik:A19.jpg|center]]
 
The '''third task''' is to add a drawing of the tracks on which the sprites move. We ask that before the start of the race one of the sprites draw the tracks on which the two sprites will be moving.
 
''The task is to remind the students the rules for using a pen and drawing planned figures by the sprite on the screen. In earlier tasks students already performed similar exercises, so they should not find implementing it difficult. We can only hint that the tracks should be simple and schematic – e.g. in the form of three lines delineating the boundaries of the tracks, and each sprite will be exactly in the middle between two of them, as shown below.''
*which way they will move – to [[Plik:A23.png|center]]  ''We point out that drawing the righttracks consists in repeating specific actions three times, and allow the students to create the left, and maybe up or downscript themselves.***selecting '' A sample modification of the direction from left to right seems natural, because scripts may look like this : [[Plik:A22.jpg|center]]  It is worth pointing out that what has been added in accordance with this version is setting the direction of reading, and has the *advantage of sprites being able '''time''' variables to travel a longer distance,*how to determine 0for each sprite at the running speed beginning of individual sprites so that each time the programme is started each sprite has a chance for the clock to winoperate properly. If none of the students have noticed this error,***ewe should help them to find it.g. sprites can move   ===Suggested additional tasks for self-completion by students=== # Adding a random, small (ethird competitor.g. between 1 and 5) number of steps, and such a random selection should take place before each sprite moves on # Adding an audience that is active during the board – until one of them crosses the finish line,race.
181
edycji