Exemple #1
0
 /// <summary>
 /// Explosion
 /// </summary>
 /// <param name="position"></param>
 /// <param name="content"></param>
 /// <param name="graphicsDevice"></param>
 /// <returns></returns>
 private Explosion CreateExplosion(Vector2 position, ContentManager content, GraphicsDevice graphicsDevice)
 {
     var explosion = new Explosion(entityManager, EnemyExplosionTextureName);
     explosion.Initialize(content, graphicsDevice);
     explosion.Position = new Vector2(position.X, position.Y);
     return explosion;
 }
Exemple #2
0
        /// <summary>
        /// Create asteroid explosion after an asteroid has been killed
        /// </summary>
        /// <param name="size"></param>
        /// <param name="position"></param>
        /// <param name="content"></param>
        /// <param name="graphicsDevice"></param>
        /// <returns></returns>
        private Explosion CreateExplosion(Sizes size, Vector2 position, ContentManager content, GraphicsDevice graphicsDevice)
        {
            Func<Sizes, String> fun = (explosionSize) =>
            {
                switch (explosionSize)
                {
                    case Sizes.Small:
                        return "asteroidSmall";
                    case Sizes.Medium:
                        return "asteroidMedium";
                    case Sizes.Large:
                        return "asteroidLarge";
                    default:
                        return "asteroidLarge";
                }
            };

            var texture = fun(size) + "_Animated_Trans1";
            var explosion = new Explosion(entityManager, texture);
            explosion.Initialize(content, graphicsDevice);
            explosion.Position = new Vector2(position.X, position.Y);

            return explosion;
        }