Annotated code: Circles bouncing off lines
annotated-code.maryrosecook.com
Annotated code: Circles bouncing off lines
1–10 of 70 posts
Re: Annotated code: Circles bouncing off lines
#2Re: Annotated code: Circles bouncing off lines
#3Edit: Or am I just imagining it?
Re: Annotated code: Circles bouncing off lines
#4Very cool. Interesting bit: The outcomes of the falling balls seem to differ every time, which corroborates the fact that any minor change in initial state results in vastly different outcomes. Edit: Or am I just imagining it?
Edit: Actually, it looks like the physics portion takes constant (but implicit) time steps each frame, but the time that a circle enters the simulation is based on the actual frame rate, which means when a given circle appears, the lines could be in a different location from previous runs.
Re: Annotated code: Circles bouncing off lines
#5All of that said, really cool, and seriously thank you for sharing!!
Re: Annotated code: Circles bouncing off lines
#6Is the code annotation page a library?
Re: Annotated code: Circles bouncing off lines
#7Neat! Is the code annotation page a library?
Re: Annotated code: Circles bouncing off lines
#8Neat! Is the code annotation page a library?
http://jashkenas.github.io/docco/
There's different ways to configure the output and layout...the Docco homepage uses a single-column format, whereas the OP uses the double-column format.
Re: Annotated code: Circles bouncing off lines
#9Re: Annotated code: Circles bouncing off lines
#10so tick calls requestAnimationFrame that calls tick that... Doesn't it create an ever growing stack? Isn't there a way to do it with a while loop?
tick calls requestAnimationFrame, tick returns, the browser waits for the next frame and calls tick...