Download presentation
Presentation is loading. Please wait.
1
How to organise your code
Pages and selection How to organise your code
2
Objective Understand what is meant by the term selection
Learn how to create pages so that you can pick different behaviours in your game.
3
What does sequence mean?
Having a look at this picture, what do you think sequence means? Why do you think we would ask you what this means in computer programming? We’re trying to get our students to understand that sequences are done in a specific order. They are carried out one after the other. When we want to make them more advanced we use something called selection.
4
What does sequence mean?
Having a look at this picture, what do you think sequence means? Why do you think we would ask you what this means in computer programming? We’re trying to get our students to understand that sequences are done in a specific order. They are carried out one after the other. When we want to make them more advanced we use something called selection.
5
What does selection mean?
Selection allows your code to do things based on choices. Our first lines of code use simple selection “When this happens do this” Look at the first line. When bump into apple…. Do eat We can make it more advanced by using pages. We’re trying to get our students to understand that sequences are done in a specific order. They are carried out one after the other. When we want to make them more advanced we use something called selection.
6
Try using an indent and show evidence of it.
Advanced selection? To save yourself from having to re do the bump apple, time after time, we can say ‘IF’ the first line occurs….. Do everything underneath which is indented. See the diagram Notice the indent…. Try using an indent and show evidence of it.
7
Organise your code… It’s better for programmers to know what is going on with their code. If you split things up over pages you can see where your problem occurs: The program below shows that something else is going to happen which is on page 2. I now know that any errors occuring could be found on page 2.
8
Tinker Time We do not want you to break the game / world you’ve already started. This is experimental time. Can you do the following and get snippets of your code. Print screen some basic sequences and explain what a sequence is. Explain what ‘selection’ is and demonstrate it through a piece of code. This should be in the same document. Try some advanced selection using indent and explain if it worked or not. If you had problems you can document the work. Challenge – Can you make use of pages to make your game more organised. For example, lives could be found on page 2.
9
Game continuation: - Use your initial plan and start building your game. You must show your teacher printed evidence of: Sequences Selection Advanced Selection Advanced selection with pages (Challenge)
10
Activity Teacher lead activity
Ask pupils if they think they know what pseudo code is. Get them to think about some of the actions which are likely to take place within their game. They will need to write out some code in structured English in the next lesson.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.