The universe object
Javascript April 8th, 2007
The latest stable version of Gravity Pad has been posted. This version is severely limited, but serves as a good demonstration of the simulation. My next big step in the project is building a more functional user interface that allows the user to tinker with the planets in their universe.
Drawing to the canvas is a simple procedure that’s somewhere between the old Windows GDI library and LOGO style vector drawing. Placing the circles which would represent my planets did not take long to figure out. Learning how to animate them was not very difficult either.
A generic animation object I wrote a few months back worked well as the animation controller for my canvas based graphics. By putting my draw_canvas function into the animation controller, I could refresh and redraw the canvas at 24 frames per second. Even heavy use of semi-transparency had minimal effect on the render speed.
I’ve been one of the main javascript programmers in my office for about a year now. So exploring new uses and tools in browser is a large part of my job. Building this latest version of my gravity toys in javascript was a fun and rewarding detour from the usual work of upgrading admin interfaces.
Recent Comments