예제 #1
0
파일: Explosion.cs 프로젝트: kn222gp/1DV437
        public Explosion(Texture2D explosionTexture, Camera camera)
        {
            _explosionTexture = explosionTexture;
            _camera = camera;
            timeElapsed = 0;

            frameWidth = _explosionTexture.Width / numFramesX;
            frameHeight = _explosionTexture.Height / numFramesY;
        }
예제 #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);
        }