/// <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 texture = Content.Load<Texture2D>("explosion"); camera = new Camera(graphics.GraphicsDevice.Viewport); explosion = new Explosion(spriteBatch, texture, camera); // TODO: use this.Content to load your game content here }
public Explosion(SpriteBatch spriteBatch, Texture2D explosionTexture, Camera camera) { _camera = camera; timeElapsed = 0; _spriteBatch = spriteBatch; _explosion = explosionTexture; frameWidth = _explosion.Width / numFramesX; frameHeight = _explosion.Height / numFramesY; }