Zmiany

Skocz do: nawigacji, wyszukiwania

Module 2 - The “Cat Chasing a Mouse” Project

Dodane 3742 bajty, 20:10, 6 lip 2015
: ''We have gone to the '''stage''' edit mode.''
 
 
 
'''Task: '''
We ask that students to go to the '''Background''' tab, then click the icon to choose the new background from the library and look through available graphics in each folder. We ask them to choose the appropriate background for the game in which the Kitten will chase the Mouse.
 
===Controlling a sprite using a computer mouse ===
'''Time to complete this part: about 15 minutes '''
'''We ask the following question:'''
How have we been controlling the sprite so far, e.g. how did we do it in the previous class?
 
''Students recall that we used keys such as arrows, the space bar, etc. We ask whether '''in games we always use the keyboard to control things like this?'''
The answers will vary, we sometimes use a special device, sometimes our body, sometimes a finger or a computer mouse. If necessary, we conduct the conversation in such a way as to make the students realise that keys are not always the most convenient way of controlling a character, and on some devices they are not even available (e.g. on tablets). ''
 
'''Task: '''
We ask that students to find the block which lets us change the sprite’s viewing direction (sprite setting) in the direction of the mouse cursor. If necessary, we suggest that it is in the category of '''Movement.'''
: ''Students should find the block '''Turn to <moue pointer>.''' They can also find '''Goto <mouse pointer>.''' If they find the latter, we do not ask them to change it. We say that in that case we will test both and see which will suit us better. ''
 
 
 
'''Task: '''
We ask students to create a script for the Mouse that will always rotate the Mouse in the direction of the computer mouse pointer after we start the programme using the green flag.
: ''Students have already created an animation script using the '''always''' loop. If necessary, prompt them that this script should work similarly, that is always after the programme is started the Mouse should look in the direction of the mouse pointer. ''
 
 
 
 
'''Task: '''
We explain that the Mouse already knows where the computer mouse pointer is and is all the time looking at it. We ask the students to modify the script so that the Mouse moves in the direction of the mouse pointer, i.e. the direction in which it is looking. We remind them that we know which block allows us to move our Mouse.
 
 
 
'''We ask the following question: '''
Isn’t the mouse moving too fast?
 
: ''Some students will notice that the Mouse is moving fairly quickly towards the mouse pointer. So we discuss how to slow the Mouse down. One answer may be to use the block wait (as we used it in the animation programme). ''
 
'''Task: '''
We ask students to experiment with speeds. We ask them to try out, for example, the option '''move by 2 steps''' instead of 10.
: ''The Mouse in this case should move much more slowly, but also more precisely, because it is looking for the mouse pointer more often (after fewer steps), and so it more often adjusts the direction in which it should move. We propose to leave this speed. ''
 
 
 
===Programming the Mouse’s reaction to meeting the Kitten – conditional instruction ===
'''Time to complete this part: about 15 minutes '''
 
'''We ask the following question:'''
What should happen when the Mouse meets (touches) the Kitten (i.e. the Cat catches the Mouse)?
: ''Ideas will probably vary, ranging from an explosion to the Mouse being eaten. We should prompt the students to get the Mouse to think e.g. “Oh, the Kitten has caught me!” and stop. We discuss what blocks we can use in this case, in what order, and in which part of the Mouse script. We write down subsequent ideas on the board – for example: ''
197
edycji