XNA content.load Dependancy

Posted by Richard on Game Development See other posts from Game Development or by Richard
Published on 2012-07-10T11:32:04Z Indexed on 2012/07/10 15:26 UTC
Read the original article Hit count: 236

Filed under:

Quick question,

My project i'm building for test purposes is working fine but i have dependencies flying around everywhere due to the XNA framework.

In Update i have gametime passed everywhere... this is okay. In Draw i have gametime & spritebatch passed everywhere... this is okay.

My issue is in the content.load textures/sounds/fonts.

I have them as public variables ie Texture1 = Content.load(of texture2d)("Texture1")

I'm passing a 'Game1' pointer into the constructor of every new class being instantiated to gain access to these variables.

Am i missing an OOP trick to prevent me having to pass a pointer to 'game1' to every New class?

© Game Development or respective owner

Related posts about XNA