Science Leadership Academy

Learn • Create • Lead

SLA News:

  1. RT @sla_hsa: check out the new SLA art installation on 22nd street: http://t.co/9ykbi7UjZF

    Posted 3 days ago

This Week @ SLA:

UPDATED: HTML5 bouncing ball example

Posted by Chris Alfano in CSE-003 on

This new version of the example features better comments explaining each line of code.

It also includes the changes we made in class today to create a variable (radius or r) that holds the ball's radius and is used to make the ball bounce before any of its edges goes off any side of the canvas. (notice in the previous example that the ball doesn't bounce until its center reaches an edge)