Module 5 - The “Bounce the Ball Arcade Game” Project: Różnice pomiędzy wersjami

Z Wiki Mistrzowie Kodowania
Skocz do: nawigacji, wyszukiwania
Linia 43: Linia 43:
  
 
[[Plik:Modul_5_1.png|center]]
 
[[Plik:Modul_5_1.png|center]]
 +
 +
 +
[[Plik:A24.png|center]]
 +
 +
 +
'''We ask the following question:''' What should the ball and the racket be? 
 +
''Students will probably quite quickly answer that both the racket and the ball should be sprites which we will be able to control. If necessary, they should be prompted to come up with this answer, justifying this rather than any other choice.''
 +
'''
 +
Task:''' We ask the students to change the sprite’s name to Racket, and then draw a racket costume for it. Next, they should add a new sprite, name it Ball, and draw it a suitable costume as well. We allow a few minutes to complete this task. 
 +
 +
Together with the students we analyse and write the algorithm for the sprites: Racket and Ball.
 +
 +
'''We ask the following question:''' Where should the Racket sprite be placed after the programme is started? How should it move? How can it be simply controlled with the computer mouse?
 +
 +
''E.g. on the line where it will move. Additional question: what must we set? – Y coordinate. To
 +
what value? – One corresponding to the bottom part of the screen, e.g. 150.
 +
The X coordinate can be set to any value or to 0 if students come to such a conclusion.''
 +
''
 +
It is worth noting the findings on the schematic drawing on the board.''
 +
''
 +
The answer to the second question may be a little more complicated. Students should remember from modules two and three how to control a character using the mouse. It is worth discussing how the racket should move (just left–right if the board we adopted is as in the example). Therefore we ask: Which coordinate will be constant (Y) for the racket, and which will vary (X)? We ask the students to find a block which will allow to move the racket the quickest in accordance with the movement of the computer mouse. Students should find two blocks which will work well together: '''Set x to <0>''' and '''x mouse'''.''

Wersja z 17:20, 6 lip 2015

Logo Mistrzowie.png

These materials have been developed by Ośrodek Edukacji Informatycznej i Zastosowań Komputerów (Centre for Information Technology Education and Application of Computers) in Warsaw as part of the “Mistrzowie Kodowania”(“Coding Masters”)Programme funded by Samsung Electronics Polska, licensed under CC BY-SA “Attribution – Share Alike 3.0”.


Information

Objectives

General objectives:

  • Review and revision of previously presented Scratch commands and language structures;
  • Introduction of the message mechanism in the Scratch environment;
  • Development of an arcade game outline;
  • Implementation of the game in the Scratch environment.

Specific objectives:

  • The student will understand and be able to use appropriate structural instructions.
  • The student will understand the concept of variable and be able to use it in the programme.
  • The student will be able to send messages and programme reactions to a received message.
  • The student will be able to use stage backgrounds.
  • The student will understand how events work and know how to use them in the programme.
  • The student will be able to implement a simple arcade game in the Scratch environment.


Stages

Discussion of selected solutions of module IV additional tasks

Time to complete this part: about 15 minutes

At the beginning of the lesson we remind the students what they were supposed to prepare between classes. We invite a volunteer to present his/her solution. We discuss with the students if anyone found a different solution. We discuss the solutions (we praise every correct solution to a task).

If there was no homework, we start by repeating key issues from the previous module. We also ask if students have any doubts about their own projects. If anyone wants to show something he/she is proud of, we allow him/her to do so.

Designing and implementing a game involving hitting a ball with a racket controlled by the player using a computer mouse

Time to complete this part: about 45 minutes


We propose to create an arcade game which will involve hitting a ball using a racket controlled with the use of a computer mouse. We will start with the simplest version and then supplement it with additional elements – including a version of the game for two players controlled with the use of the keyboard.

We sketch a drawing on the board next to which we will be able to write algorithms of actions of individual sprites and what we need to do to make our game work.

Modul 5 1.png


A24.png


We ask the following question: What should the ball and the racket be? Students will probably quite quickly answer that both the racket and the ball should be sprites which we will be able to control. If necessary, they should be prompted to come up with this answer, justifying this rather than any other choice. Task: We ask the students to change the sprite’s name to Racket, and then draw a racket costume for it. Next, they should add a new sprite, name it Ball, and draw it a suitable costume as well. We allow a few minutes to complete this task.

Together with the students we analyse and write the algorithm for the sprites: Racket and Ball.

We ask the following question: Where should the Racket sprite be placed after the programme is started? How should it move? How can it be simply controlled with the computer mouse?

E.g. on the line where it will move. Additional question: what must we set? – Y coordinate. To what value? – One corresponding to the bottom part of the screen, e.g. 150. The X coordinate can be set to any value or to 0 if students come to such a conclusion. It is worth noting the findings on the schematic drawing on the board.


The answer to the second question may be a little more complicated. Students should remember from modules two and three how to control a character using the mouse. It is worth discussing how the racket should move (just left–right if the board we adopted is as in the example). Therefore we ask: Which coordinate will be constant (Y) for the racket, and which will vary (X)? We ask the students to find a block which will allow to move the racket the quickest in accordance with the movement of the computer mouse. Students should find two blocks which will work well together: Set x to <0> and x mouse.