Presentation is loading. Please wait.

Presentation is loading. Please wait.

Randomising the behaviour of Sprites Games Programming in Scratch.

Similar presentations


Presentation on theme: "Randomising the behaviour of Sprites Games Programming in Scratch."— Presentation transcript:

1 Randomising the behaviour of Sprites Games Programming in Scratch

2 Games Programming in Scratch L4 Randomising the behaviour of Sprites Learning Objectives Learn what each of the operators +, -, *, /, mod and round in the Scratch Green block menu does Use the Pick Random block to position objects randomly on the screen Understand the use of the operators, and, or, not. Use some of these in a Scratch game

3 Games Programming in Scratch L4 Randomising the behaviour of Sprites Working with Operators You have already used some operators with variables

4 Games Programming in Scratch L4 Randomising the behaviour of Sprites Where to use Randomisation You can combine the use of operators, sprites, and coordinates to make objects appear at various points on the screen randomly. For example, this might be useful if: – You died and wanted to come back to a specific location and use another life – Enemies that have been killed return – Collectable treasures appear on screen randomly Work out how to make objects appear randomly on screen

5 Games Programming in Scratch L4 Randomising the behaviour of Sprites The Scratch window The Scratch window has coordinates Where is 0,0? x y 240 -240 -180 180

6 Games Programming in Scratch L4 Randomising the behaviour of Sprites Using randomisation Make sprites appear at random locations using the Show and Hide blocks

7 Games Programming in Scratch L4 Randomising the behaviour of Sprites Getting stuck Getting stuck is all part of programming. It is learning how to find a solution that really matters. Remember, if you are stuck: 1. Try to solve the problem yourself 2. Use the help files and tutorials 3. Look at the Scratch Community projects for tips 4. Use the Internet 5. Ask a friend 6. Ask the teacher

8 Games Programming in Scratch L4 Randomising the behaviour of Sprites Comment your Code


Download ppt "Randomising the behaviour of Sprites Games Programming in Scratch."

Similar presentations


Ads by Google