Zmiany

Skocz do: nawigacji, wyszukiwania
* ''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.''  [[Plik:A20.jpg|center]]  [[Plik:A23.png|center]]  ''We point out that drawing the tracks consists in repeating specific actions three times, and allow the students to create the script themselves.'' A sample modification of the scripts may look like this: [[Plik:A22.jpg|center]]  It is worth pointing out that what has been added in this version is setting the '''time''' variables to 0for each sprite at the beginning of the programme for the clock to operate properly. If none of the students have noticed this error, we should help them to find it.  ===Suggested additional tasks for self-completion by students=== # Adding a third competitor.# Adding an audience that is active during the race.
181
edycji