I know this is a question that has been discussed here before, but in all my searches, I haven't found a solution.
I got a particle system (
from here) to work with my game. I got my game (without the particle system) to work within the GameStateManagement sample. I have been trying to add the particle system back into my game within the GameStateManagement sample, but am having issues.
So far, I have not actually tried to create any explosions in the game, I've just been trying to add in the classes needed for the particle system. Those include ExplosionParticleSystem.cs, ExplosionSmokeParticleSystem.cs, Particle.cs, and ParticleSystem.cs. I have not changed anything in those files other than changing the namespace to "GameStateManagement" and changing lines like "private Game1 game" to "private GameStateManagementGame game".
The errors I'm currently getting come from the "Draw" method in ParticleSystem.cs.
| public override void Draw(GameTime gameTime) |
| { |
| game.SpriteBatch.Begin(spriteBlendMode); |
The error is
Error 1 'GameStateManagement.GameStateManagementGame' does not contain a definition for 'SpriteBatch' and no extension method 'SpriteBatch' accepting a first argument of type 'GameStateManagement.GameStateManagementGame' could be found (are you missing a using directive or an assembly reference?)
I've tried changing the above line to
"SpriteBatch spriteBatch = ScreenManager.SpriteBatch;"
which doesn't work either.
I've uploaded the source code
here.
I'd really appreciate suggestions on the best way to get this working. Thanks!