|
Computer Science Home
6th Grade Tech Ed
7th Grade Computer Science
8th Grade Computer Science A
Gmail
Google Drive
Google Classroom
Infinite Campus
Typing.com
(Join Class through Google Classroom)
Schoology
Code.org
Tynker Coding Website
Tynker Resource Page
Tynker Online Support Video Help
Quizlet | Quizlet LIVE
Everfi
Khan Academy
Social Media Tips
Netsmartz
Code HS
Karel the Dog class code: 1251
CSTA Standards
ISTE Standards
|
Lesson 10 - Gravity and Bouncing
In this lesson, students will expand on physics engine concepts by learning how to make Actors bounce and alter the direction of gravity!
New Code Blocks
- : Set the restitution of the Actor, which affects its bounciness.
- : Apply an impulse of the specified magnitude and angle to the Actor.
- : Set whether the Actor uses physics and can affect other Actors that use physics.
- : Set whether the Actor (if active) is unaffected by gravity or collisions. An Actor that is not static will fall due to gravity, while an Actor that is static will not.
Vocabulary
- Impulse: A strong, sudden force
- Restitution: How bouncy an object is
Objectives
- Use code blocks to make Actors bounce and alter the direction of gravity
- Create projects using the physics engine code blocks
Think About It:
- What would happen if games didn’t apply gravity to Actors?
- Do you think unrealistic physics features (e.g., a basketball that doesn’t bounce) will ruin or enhance the gameplay experience? Explain.
Lessons:
1. Bouncing Ball Example (Example)
- Students will watch a project of a bouncing ball. They’ll create their own version of this project in the next module!
- Tell students to click (web) or tap (mobile) the red stop button to move on to the next module.
2. Bouncing Ball (DIY)
- In this DIY (do-it-yourself) project, students will follow step-by-step directions to learn how to program a ball to bounce.
- Explain to your students that changing the value of the “set restitution” code block can make the ball more bouncy or less bouncy. Increasing the restitution makes the ball more bouncy, and decreasing the restitution makes the ball less bouncy. Note: The “set restitution” code block doesn’t work with negative numbers.
- Did students finish early? Ask them to add more Actors and program them to bounce!
3. Gravity Simulation Example (Example)
- Students will watch a project that simulates different levels of gravity. They’ll create their own version of this project in the next module!
- Check that students are clicking (web) or tapping (mobile) the different colored buttons.
- Optional: Ask students to compare and contrast how the different buttons affect the owl.
4. Gravity Simulation (DIY)
- In this DIY project, students will create a project that demonstrates different gravity settings.
- "Remind students that the "set gravity to" code block has two values: the horizontal value and the vertical value. A positive horizontal value will pull Actors to the right, while a negative horizontal value will pull them to the left. A positive vertical value will pull Actors down, while a negative vertical value will pull Actors up."
- Did students finish early? Ask them to explore the bonus activity in “Step 4” of the tutorial which encourages students to modify the owl’s restitution.
5. Owl Bounce (Puzzle)
- To solve this puzzle module, students will need to modify the owl’s restitution so it lands on the platform.
- Give a hint: Ask students what value makes the owl bounce higher with each bounce. What value will make the owl bounce a little lower with each bounce? (Answer: A restitution value greater than 1 will make the owl bounce higher with each bounce. A restitution value less than 1 will make the owl bounce a little lower with each bounce.)
6. Gravity Madness Simulation Example (Example)
- Students will watch a project of different balls bouncing. They’ll create their own version of this project in the next module!
- Check that students are pressing the arrow keys (web) or tilting their device (mobile) to change the direction of gravity.
7. Gravity Madness (DIY)
- In this DIY project, students will learn how to alter the direction of gravity!
- Activities include adjusting the bounciness of different balls and programming controls to change the direction of gravity.
- The first number in the “set gravity” code block is the x-axis, and the second number is the y-axis. Optional: If needed, draw a coordinate plane for your students and remind them which directions have positive or negative values.
8. Bug Ball Example (Example)
- Students will play a completed Bug Ball game. They’ll create their own version of this game in the next module!
- How to play: Tell your students to use the arrow keys (web) or tilt their device (mobile) to apply impulses to the bug. The goal of the game is to hit the icefly with the bug and get the icefly onto the platform.
9. Bug Ball (DIY)
- In this DIY project, students will learn how to create a game that uses the “apply impulse” code block, which moves objects with a given amount of force. Who can get the icefly onto the platform the fastest?
- Point out to students that the bug transfers its force to the icefly when they bump into each other.
- Is the game too difficult? Ask students to change the value of the “apply impulse” block.
U.S. Standards
- K-12 CTSA Computer Science Standards (Revised 2017)
Computer Science Teachers Association:
- 1B-AP-10
- 1B-AP-11
- 1B-AP-12
- 1B-AP-15
- 2-AP-12
- 2-AP-13
- 2-AP-15
- 2-AP-16
- 2-AP-17
CCSS-Math: MP.1
- CCSS-ELA: RF.5.4.A, 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
- CS CA: 3-5.AP.10, 3-5.AP.12, 3-5.AP.13, 3-5.AP.14, 3-5.AP.17, 6-8.AP.12, 6-8.AP.13, 6-8.AP.16, 6-8.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
|