Conscious   -  Nov 18, 2012

Been doing some html5 canvas work. http://fiddle.jshell.net/tLpEV/5/show/

Will post it when I do partitioning :D

SnoooP  -  Nov 18, 2012

I don't understand why things like that fascinate me, I could sit watching for hours :D

Hawkee  -  Nov 18, 2012

Nice, post some code.

[Plornt]  -  Nov 18, 2012

Be careful when you are making animations. Set interval is not advised simply because it doesnt actually run it at the time you want it to. If you use request animation frame (http://paulirish.com/2011/requestanimationframe-for-smart-animating/) and then tell your balls to move (milisecondsSinceLastFrame * velocityPerMilisecond) + this.velocity_x

This basically ensures if the starting conditions was the same it would look the same across all computers and platforms. Other than that nice work. Collisions are an absolute pain in the arse.

FelicianoX  -  Nov 18, 2012

Here's something similar I did few months back, http://tennis.site40.net/scripts/js/bouncingBalls.html

It doesn't have collision detection. And the code sucks.

Conscious  -  Nov 19, 2012

@Hawkee that code is at http://jsfiddle.net/tLpEV/5/
@[Plornt] will look into it, thanks

Conscious  -  Nov 19, 2012

@[Plornt] why the addition of the velocity if you're already multiplying it by the ms times velocity?

[Plornt]  -  Dec 02, 2012

@Conscious EDIT: Just got what you are saying. I believe thats supposed to be position X. Cant remember my trail of thought. Sorry for late reply as I got no email notifications.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.