Easily decorate an HTML canvas with a bouncy ball mini-game.
Just include the script into a page and decorate a canvas
with the bouncy-ball
id...
<canvas id="bouncy-ball"></canvas>
<script src="BouncyBallGame.js"></script>
... then click on the canvas to get going. See the code for a more complete example which is on display here.
Make the game resistant to canvas resizing.Respect ball radius in boundary collisions.Scale the ball speed to better match canvas size?- Ball-on-ball collisions?!?!