A JavaScript Orrery

For my 2D Graphics module coursework, I am tasked with making an orrery (a device that illustrates the relative positions and motions of the planets and moons in the Solar System) in JavaScript using HTML5 Canvas. JavaScript is a new language for me, I’ve never coded in it before. It is based on C so it was fairly similar to using C#, in which I’ve made a fair number of Windows Phone apps.

I’ve found it fun once I get stuck in, and it’s nice to see your code changes instantly reflected in the browser page after hitting F5. I’ve had a bit of trouble understanding prototyping. Apparently I need to declare all my variables as separate prototypes even though you can declare them as vars or even just use this.variable = x for example in the class constructor, without even declaring it as a variable. The loose typing seems a bit crazy to me.

Anyway, I have all the planets orbiting around the sun at different speeds. You can speed up and slow down time, even reverse it which is fun. I’ve also added the ability to zoom in and out and navigate around. There is still a lot to do to meet the spec, such as different drawing modes and gravity simulation which sounds difficult.

On another topic, the Windows Phone 8 SDK has been released finally. I’m hoping to port my Sweepy Cleaner and Classic Pong to WP8 - take advantage of the bigger screens and make a few changes based on feedback. It probably won’t be for a while however, as Uni work takes priority. That’s all for now.