Bouncing Squares - a particle system with basic gravity

View code Play Walkthrough

Just some simple boxes that bounce. A very basic implementation of gravity in a particle system on HTML5 canvas.

«
Add New Comment

3 Comments

(close)
Alex

Alex

hey there, great walkthrough. I wonder if its intended that you call your box.update method twice per intervall? Once in the box.draw method and later in the main update method through the loop over each box

Lee

Lee

I cannot get this to work…I keep getting the errors that fillStyle and fillRect are not a function even though I have everything set up exactly as in this tutorial with html5 doctype and includes set up properly in index.html. I am a canvas n00b though, but I don’t understand why this works but mine doesn’t. What am I missing?

Muhammad Farooqi

Muhammad Farooqi

excellent.. it’s really aowsome.. i didn’t know how easy is to make gravity.. and this is really beautiful.. really loving :)

TheCodePlayeralpha

3 Comments

Description

5x 10x 15x 20x