/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); Texture2D explosion = Content.Load<Texture2D>("explosion"); camera = new Camera(graphics.GraphicsDevice.Viewport); explosionManager = new ExplosionManager(spriteBatch, explosion, camera); // TODO: use this.Content to load your game content here }
public ExplosionManager(SpriteBatch spritebatch, Texture2D Explosion, Camera Camera) { timeElapsed = 0; //denna ska vara 0 när programmet startas camera = Camera;//så jag kan använda kameran i klassen! spriteBatch = spritebatch; explosion = Explosion; Width = explosion.Width / posFramesX; //delar explosionens bredd med positions framesen! Height = explosion.Height / posFramesY; }