Ejemplo n.º 1
0
        public Explosion(Texture2D explosionTexture, Camera camera)
        {
            _explosionTexture = explosionTexture;
            _camera = camera;
            timeElapsed = 0;

            frameWidth = _explosionTexture.Width / numFramesX;
            frameHeight = _explosionTexture.Height / numFramesY;
        }
Ejemplo n.º 2
0
        /// <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);

            // TODO: use this.Content to load your game content here
            explosionTexture = Content.Load<Texture2D>("explosion.png");
            camera = new Camera(graphics.GraphicsDevice.Viewport);
            explosion = new Explosion(explosionTexture, camera);
        }