What does the code mean?
When the flag is clicked do the action forever, if the rabbit is not touching the fox then the rabbit will move 10 steps and point towards the fox.
If the Fox is touching the Rabbit the Play a Pop Sound and display the message Gotcha! for 2 seconds
If the sprites hit an edge then bounce.
Task 9 – Adding a Script to the Fox Sprite
Click on the Fox Sprite just under the stage, this will make sure that the script you are about to make is attached to the correct sprite.
Click the Control button and drag the across and place it into the scripts area.
Click the Control button and drag the across and place it underneath.
Click the Motion Button and drag the across and place it within the forever loop.
Click the Sensing Button and drag the across and place it over the 0 like this :-
Click the Motion button and drag the across and place it underneath the
Click the Sensing button and drag the across and place it over the 0 like this:-
Click the Motion button and drag the across and place it underneath the end script should look like this:-
9. Click on the Green Flag and test your program.
10. Save your work as Chase Me.
Save your Work
You have finished this booklet you will have to ask for the Track Game Worksheet.
Mr. Nouman/ Mr. Akmal
Do'stlaringiz bilan baham: |