Example #1
0
        public void CreateExplosion(Sprite sprite)
        {
            var centerOfSprite = new Vector2(sprite.Position.X + (sprite.Width / 2), sprite.Position.Y + (sprite.Heigth / 2));
            var explosion = new Explosion(texture, centerOfSprite, bounds);
            explosion.Position -= new Vector2(explosion.Width / 2, explosion.Heigth / 2);
            explosions.Add(explosion);

            soundManager.PlayExplosionSound();
        }
        public Applicationview(ContentManager _content,Camera _camera,SpriteBatch _spritebatch)
        {
            content = _content;
            camera = _camera;
            spritebatch = _spritebatch;

            splittertexture = content.Load<Texture2D>("spark");
            smoketexture = content.Load<Texture2D>("smoke");
            explosiontexture = content.Load<Texture2D>("explosion");
            shockwavetexture = content.Load<Texture2D>("Shockwave");

            splittersystem = new SplitterSystem(splittertexture, spritebatch, camera, scale, startpos);
            smokesystem = new Smokesystem(smoketexture, spritebatch, camera, startpos);

            explosion = new Explosion(explosiontexture, spritebatch, camera, scale, startpos);
            shockwave = new Shockwave(shockwavetexture, spritebatch, camera, startpos);
        }