Day 10: “Fuck it, We’re Going Vector”
I kept playing with the level designs, and noticed a common pattern: Draw an object in Inkscape, paste it into a tileset, drop that tileset into a level once. I realized that, for the type of levels I want to have, tiling is mostly a waste because too many tiles are only used once. And in that case, there’s no point in having it used up as bitmap data. From here on out, Ratform levels are SVGs. Not in that toy “draw a rope and now it has physics!” way, but particularly structured Inkscape SVGs. The W3C really fucked up on the SVG format. For a casual implementation (the type of hack implementations that get a format entrenched), the totally blew it with Elliptical Arcs. You go through, adding features as you need, until you hit Elliptical Arc (A/a). Look at this, and tell me how you’d BEGIN to implement it: http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands
I ported Raphael.js’ implementation to Ruby, and it’s 116 lines of heavy trig. 116 lines of Ruby is saying a lot. Anyway, pictured here is my mostly-working SVG renderer. Not rigged to anything yet, plan to implement gradients and shadows and call it done.