Hi All,
I've had a nose around these forums, Googled, and read the two books I've got on XNA, but nowhere can I find a decent description of XNA's GameComponent lifecycle.
In what order do Initialize, Update, Draw and LoadContent get called? The MS reference for LoadContent said that it should be used for loading any graphics-specific stuff; however when I do this my component's Draw method is called before LoadContent (which seems a little strange!) and is therefore throwing nullpointers because it can't find references to any of the textures I've tried to load in.
I'm writing my code like this - is this 'best practice'?
Constructor - creating instances of things that don't rely on external sources, or instances that will ask for external resources later
Initialise - getting references to Services (SpriteBatches, ContentManagers etcetera)
LoadContent - making calls on those services I've now got references to in order to load in textures and the like
Managing Director, Binary Tweed Ltd.
binarytweed.com New games that're a bit like old games, but better.
Clover: A Curious Tale - New, improved, and coming to PC.
Clover - Watercolour political platform puzzler.
Free Blitz 1UP games in return for testing!