Game Lab
with code.org
In this unit you will learn how to program in JavaScript with Code.org. This site allows you to switch between Block programming (like Scratch) and text programming.
Your class will build a game based on work from the interactive games and animations 2023 course. Your teacher will invite you and set the work to do.
You will also cover some Computer Science Topics. Your teacher will quiz you on these at the end of the unit.
Google Classroom has a Game Lab assignment for you to place your mini skills links in.
Comp Sci Topic: Input, Process, Output
TASKS
These tasks target the skills you need in to learn in Year 10.
Code.org has many other lessons which cover more skills. You do not need to complete everything in Code.org.
As you complete tasks you will build a simple game to apply the skills.
Drawing with Shape & Colour
Purpose:
We are learning the basics of Game Lab by drawing shapes.
Task:
Log in to Game Lab - Use the link provided by your teacher
Find the Interactive Animations and Games tutorial
Complete lessons 3 & 4 - Drawing and Parameters
Extension:
Do some of the challenges at the end of the unit
Comp Sci Topic: - Operating systems and Application software
You will be designing application software in GameLab!
Variables & Randomness
Purpose:
We are learning about variables and how to use randomness in our code.
Task:
Find the Interactive Animations and Games tutorial
Complete lessons 5 & 6 - Variables & Randomness
Extension:
Do some of the challenges at the end of the unit
Comp Sci Topic: Algorithms
Sprites
Purpose:
We are learning how to create sprites.
We are setting up the game that we will develop as we go. Example
Task:
Find the Interactive Animations and Games tutorial
Complete lessons 8 & 9 - Sprites & Properties
Create a new Game Lab project named yourname-10DTEC-skillsproject
Add a sprite, give it an animation - ignore the draw() function for now. Example
Save and Share it
Turn it in to Google Classroom
Extension:
Customise your sprite
Add more sprites
Text - Very short unit
Purpose:
We are learning how to display text
Task:
Find the Interactive Animations and Games tutorial
Complete lesson 10 - Text
Open your Game Lab project named yourname-10DTEC-skillsproject
Add a title to your game - Make it pretty. Example
Extension:
Do some of the Challenges in the unit
Your project should look a bit like this
The Draw loop and movement
Purpose:
We are learning how to move our sprite
Task:
Complete lessons 12 & 13 - Draw Loop and Movement
Open your Game Lab project named yourname-10DTEC-skillsproject
Make your sprite move. Example
Extension:
Do some of the Challenges in the unit
Conditionals - if statements
Purpose:
We are learning how to control our program with logic
Task:
Complete lesson 15 - Conditionals
Open your Game Lab project named yourname-10DTEC-skillsproject
Add an if statement so that when the sprite reaches the right hand side it goes back to the start. Example
Extension:
Do some of the Challenges in the unit
Comp Sci Topic: Searching and sorting algorithms
Keyboard input and start screens
Purpose:
We are learning how to control our program with the keyboard
Task:
Complete lesson 16 - Keyboard Input
Open your Game Lab project named yourname-10DTEC-skillsproject
Add code to move your sprite with the arrow keys. Example
Follow the slides to create a start screen in your game. Example
Extension:
Do some of the Challenges in the unit
Add more screens
Velocity
Purpose:
We are learning a different way to move our sprite. This can give a totally different feel to your game.
Task:
Complete lesson 19 - Velocity
Open your Game Lab project named yourname-10DTEC-skillsproject
Change your controls so the character starts drifting when the keys are pressed. Example
Extension:
Do some of the Challenges in the unit
Press use a key to stop drifting
Make the character go faster the longer the key is pressed
Touching
Purpose:
We are learning how to detect when our sprite touches something else.
Task - Lots to do this lesson:
Complete lesson 20 - Collision Detection
Open your Game Lab project named yourname-10DTEC-skillsproject
Add a pickup sprite
Create a "score" variable
Use text() to display the score
When your original sprite touches the pickup sprite:
Your score goes up
The pickup sprite teleports to a random position
Extension:
Do some of the Challenges in the unit
Add a sprite to avoid that reduces your score
Sometimes the pickup appears on the character. Can you find a solution?
Gravity
Purpose:
We are learning how to create a gravity effect
Task:
Complete lesson 22 - Complex Sprite Movement
Open your Game Lab project named yourname-10DTEC-skillsproject
Make your character fall - like in the falling rock activity: Example
Extension:
Do some of the Challenges in the unit
Find a way to stop your character falling through the floor (use an if() statement)
Collisions
Purpose:
We are learning how to collide with other sprites
Task:
Complete lesson 23 - Collisions
Read the help about the bounciness sprite Property
Read the help about edges
Open your Game Lab project named yourname-10DTEC-skillsproject
Add a platform sprite under your character for it to start on
Add edge collisions. Choose the best collision method to make it work: Example
Extension:
Do some of the Challenges in the unit
To get your game working well you will need to play with your sprite's bounciness property. Try setting it to a number like 0.5
To get the edges working you can use
and
Hint: do all the bounceOff() bits before you do the keyboard movement code.
Functions
Purpose:
We are learning how to tidy up our code with functions
Task:
Complete lesson 25 - Functions
Open your Game Lab project named yourname-10DTEC-skillsproject
Put all your start screen code in one function
Put all your game code in another function
Modify your draw loop so it looks like the example: Example
Extension:
Do some of the Challenges in the unit
Add a win screen (when you get 5 points)
Add a restart button
Example draw loop
Jumping
Purpose:
We are learning how to create a jump mechanic
Task:
Look at the slides
Open your Game Lab project named yourname-10DTEC-skillsproject
Change your movement controls so your sprite can jump
Add platforms so you can get to all parts of the screen: Example
Extension:
Do some of the Challenges in the unit
Add a win screen (when you get 5 points)
Add a restart button