Saturday 24 October 2009

It grows!

I haven't slept recently, and consequently my small spidery bit has grown into a larger multi-spidery-combination-seaweedy bit. The pic doesn't rly do it justice:

The 'trees', which is what I called their class although I prefer to think of them as seaweed fronds, have been procedurally animated too, so they sway gently in the breeze.... Well they did all sway the same way, but then I discovered it looked cooler if I de-synched the swaying, so now its more like they are being troubled by a gently troublesome tide. 

In addition I have given the yellow spiders a mind of their own so they just wander around sniffing about (insofar as a broken spider is capable of sniffing), within a predefined area. Not really sure where this is going next, mostly because vista restarted due to updates and murdered my todo list.

Technical crap - this is generally how it works so far:

  • GameObject is (sort of) the base class, and it contains basic stuff like virtual update functions and matrices
  • All high-level things that exist in the game(lol), inherit from the abstract Entity class, which in turn inherits from GameObject
  • Anything which inherits from Entity will contain a list for things which inherit from DrawnObject
  • DrawnObjects are also inherited from GameObject, and contain a list for Lines, and a list for Shapes
  • The spider is an Entity, it contains legs and a body, which in turn are DrawnObjects, made out of lines and shapes
  • The scenery is an Entity, it contains trees and the background, which are DrawnObjects etc.
  • When it comes time to draw the scene the entity class stuffs some pointers to the contents(lines & shapes) of its constituent DrawnObject list into a 'DrawPackage'.
  • DrawPackages hold pointers to things that want to be drawn, as well as the mean Z co-ordinate for that item.
  • The DrawPackages all get transformed by the relevant matrices before being shipped off to the DrawMachine, which waits until all are present before Depth-sorting and ultimately drawing them to the screen.

Dunno if all that makes sense..it's a rough overview anyways. Even though I set out to design it in a highly OO style I can see many things which I would like to have done differently, if I could be bothered to do it again... And I suppose I will be bothered to do it again since it's an assignment, ha.


Sayonara 

1 comment: