CLASS21
CLASS21
Class C21
● Student Resources
○ Laptop with internet connectivity
○ Earphones with mic
○ Notebook and pen
CONTEXT
● Review the collision and bounceOff algorithm created in the last class.
● Writing function for DRY
Awesome. ESR:
We checked if the object
Do you remember how our bounceOff had collided and then
algorithm worked? reversed their velocities.
CHALLENGE
● Write a collision function which works for any two game objects.
For now, our isTouching function only The student observes and
checks collision between the learns.
movingRect and fixedRect. We
should be able to check collisions
between any two objects.
ACTIVITY
● Write a bounceOff function which works for any two game objects.
● Creating a small code library which can be used with any project and allow
one to use collision and bounceOff functions.
Step 3: Guide the student to get started on The student adds the
Student-Led his/her project. bounceOff project from the
Activity last class in their code
(15 min) editor. (Student Activity 2)
For now, we will learn how to quickly The student creates a js file
create our own library with functions called myOwnLibrary
which we can use in any project. inside the same project.
You get Hats Off for your excellent Make sure you have given
work! at least 2 Hats Off during
the class for:
Project Overview Note: This is a tiered project with multiple Students engage with the
tasks. All students must do the main task. teacher over the project.
The main task is very similar to the
projects that are already live. Each tiered
project has two or more additional tasks
which are optional.
Story:
John and Jacky are two brothers who
are planning to create a game. They
are creating a game in which the box
will start moving with a specific
velocity and its color gets changed
according to its colliding surfaces'
color.
Bye Bye!
Teacher Clicks