Learning Outcomes
Learning Outcomes:
Explain the term Algorithm
Analyse flow charts
Understand the Scratch interface
Add backgrounds to a Scratch project
Add Sprites to a Scratch project
Understand the use of movement bricks within Scratch
Apply control structures to a Sprite
An algorithm is a set of instructions which performs a task or solves a problem. These are often used to plan out how software will work. For example an algorithm for crossing the road might be...
STEP 1: Look Left
STEP 2:Look Right
Is the road clear?
Yes: Step 3: Cross the Road
No: Step 4: Return to Step 1
We can also represent algorithms as flow charts. The image opposite shows what a flow chart for the algorithm above might look like.
Every computer game and app you have ever used will have thousands of different algoritms which control how the computer carries out different tasks.
We create algorithms during the design stage, this should make it easier for us to actually create the program.
You can find out more about flowcharts here:
https://www.bbc.co.uk/bitesize/guides/z3bq7ty/revision/3
When we find a problem in our code we have to look back through it carefully to find the problem. This is called debugging. Sometimes our code is incorrect and so the program will not run at all or sometimes it will do something other than what we expect. It is important to check carefully through your code when you identify issues.
In this project all Keystage 3 will be creating a Scratch game based around the Eco Schools Project the school is involved in. Your teacher will ask you to come up with possible ideas and then decide on a game idea which the whole class will produce. You can adapt the game in whatever way you like but it must be based around the theme of Eco Schools.
Can you think of any interesting environmentally themed game ideas?
In this project we will be creating a script ( a block of code) which allows a sptite to move around the screen based on the user pressing a button.
The green flag button is needed so the Computer knows what to do when the program starts.
Go to x y tells our character to go to a certain location on the screen at the start of the game. You can change these numbers to move the character around.
The forever loop is used so the script is constantly running throughout the program.
The IF key pressed block is checking to see if a certain key has been pressed.
The change x/y by block will move the character on the screen. Remember the x axis controls movement across the screen on a horizontal plane. The y axis controls movement up and down on the vertical axis. The larger the number the faster the sprite will move.
We use negative values to move the sprite to the left and down.
This script is to be applied to the fish, these will act as your lives in the game. You will have to try and stop the litter from touching the fish. If a fish touches the litter it will die. This code will get the fish swimming across the screen.
This script will make the fish disappear when it touches the trash object.
These scripts will make your trash objects fall from the top of the screen to the bottom. The script on the right will make the trash disappear when it touches the diver.
Have you made good use of Backgrounds?
Have you made good use of Sprites?
Is your control system intuitive?
Is your sprite size and speed effective?
Have you created interactions between sprites?
Have you created an enjoyable game?
Have you made use of animations to improve the game visually?
Have you made use of variables effectively?
Does your game have multiple levels/players?