Please enable JavaScript to use CodeHS

Coding in Science

Bouncing Ball Simulation

[High School, 2-4 Hours] Students create a bouncing ball simulation in JavaScript, complete with gravity and collisions!

Lessons

4.1 Introduction to Graphics Programming

  • Introduction to Graphics Programming
  • Drawing a Ball
  • Have a Ball!

4.2 Adding Gravity

  • Adding Gravity
  • Ball in Motion
  • To the Moon

4.3 Time to Impact

  • Time to Impact
  • Make an Impact
  • Sanity Check

4.4 Elastic Collisions

  • Elastic Collisions
  • Bounce the Ball
  • Off the Wall!
  • Keepin' it Real (Elastic)

Courses that include this module