Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 Dec 2012
Offline Last Active Dec 12 2013 07:22 AM

Posts I've Made

In Topic: [Solved] Loading enemies method

28 December 2012 - 06:26 PM

Fixed it all by re-doing the whole spawning code myself. Note to self: try something first before looking at books to do it


thanks for the help!

In Topic: [Solved] Loading enemies method

28 December 2012 - 02:09 PM

I'm refering to the "Class" called game.cs.  It's in the picture as well.  Essentially, your code is asking for an object called "Content", Content exists in the Game.cs class, which inside is usually named Game1.  
This function for loading enemies needs to be inside the Game1 class, or the Content object needs to be exposed to the other class some how.  


Ive now done this, I've moved the loading enemies into the Game class in the LoadContent() region however I'm getting the same thing :S

Also, what is the book you are using.  They are having you repetitively load an image during game play.  That's typically a bad idea, as it is faster to load it once in to a variable, and then reuse it as you need.


Im using "Learning XNA 4.0" by Aaron reed :)

In Topic: [Solved] Loading enemies method

27 December 2012 - 01:11 PM

Oh!  my bad,  that function either needs to sit in the Game1 class, (where you will find the Content object) or, you need to somehow expose the Content object.


I dont have a Game1 function, most of my code is in the GameplayScreen class, here is my heirarchy: