I thought adding camera control would be a lot harder than it turned out to be. Turns out the basic principle is pretty simple; create a container sprite (‘camera’) for all the objects in the game world, then modify it’s position/scale etc to give the impression of panning and zooming.
I’ve created a seperate ‘Camera’ class for this, with ‘pan’ and ‘zoom’ as public functions, giving me a bit more flexibility as to where I can manipulate the camera.
The idea here is for each shape to have its own attraction/repulsion system, being attracted to shapes with more sides, and repulsed from shapes with less sides… I was hoping it would create a dynamic system of constantly moving shapes, chasing each other and being chased, but so far it’s just resulting in shapes being clumped together.
I think its a case of messing around with each shape’s impulse formula till I get the effect I want.