public void Inicializar(Animacion animacion, ContentManager content, GraphicsDevice graphicsDevice, Vector2 DireccionDisparos, bool puedeDisparar = false)
        {
            this.DireccionDisparos = DireccionDisparos;
            this.puedeDisparar = puedeDisparar;
            this.graphicsDevice = graphicsDevice;
            AnimacionEnemigo = animacion;
            Posicion = animacion.Posicion;
            Activo = true;
            Vida = 100;
            Danios = 10;
            VelocidadMovimiento = 6f;
            Puntos = 100;

            // Rastro de partículas :D
            var textures = new List<Texture2D>();
            textures.Add(content.Load<Texture2D>("spark"));
            particleEngine = new ParticleEngine(textures, new Vector2(400, 240));

            // Proyectiles
            proyectiles = new List<Projectil>();
            TexturaProyectil = content.Load<Texture2D>("minibullet");
        }
        private void AgregarEnemigoTerrestre()
        {
            var AnimacionEnemigo = new Animacion();
            var Posicion = new Vector2(800, random.Next(400, 480));
            AnimacionEnemigo.Inicializar(texturaEnemigoTerrestre, Posicion, 100, 138, 1, 1, Color.White, .5f, true);

            var Enemigo = new Enemigo();
            Enemigo.Inicializar(AnimacionEnemigo, Content, GraphicsDevice, new Vector2(-3, -5), true);
            EnemigosTerrestres.Add(Enemigo);
        }
        private void AgregarEnemigo()
        {
            var AnimacionEnemigo = new Animacion();
            var Posicion = new Vector2(GraphicsDevice.Viewport.Width + texturaEnemigo.Width / 2, random.Next(100, GraphicsDevice.Viewport.Height - 100));
            AnimacionEnemigo.Inicializar(texturaEnemigo, Posicion, 47, 61, 8, 30, Color.White, 1f, true);

            var Enemigo = new Enemigo();
            Enemigo.Inicializar(AnimacionEnemigo, Content, GraphicsDevice, new Vector2(-5, 0), true);
            Enemigos.Add(Enemigo);
        }
 private void AddExplosion(Vector2 position)
 {
     Animacion Explosion = new Animacion();
     Explosion.Inicializar(texturaExplosion, position, 134, 134, 12, 45, Color.White, 1f, false);
     Explosiones.Add(Explosion);
 }
        protected override void LoadContent()
        {
            // El SpriteBatch se usa para dibujar todo.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Animacion AnimacionPersonaje = new Animacion();
            Texture2D TexturaPersonaje = Content.Load<Texture2D>("shipAnimation");
            AnimacionPersonaje.Inicializar(TexturaPersonaje, Vector2.Zero, 115, 69, 8, 30, Color.White, 1f, true);

            PosicionInicialPersonaje = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y
            + GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
            player.Inicializar(AnimacionPersonaje, PosicionInicialPersonaje, Content, GraphicsDevice);

            InicializarFondos();

            // Sonidos
            MusicaEnJuego = Content.Load<Song>("sound/gameMusic");
            SonidoExplosion = Content.Load<SoundEffect>("sound/explosion");
            font = Content.Load<SpriteFont>("gameFont");
            PlayMusic(MusicaEnJuego);
        }
        public void Inicializar(Animacion animation, Vector2 position, ContentManager content, GraphicsDevice graphicsDevice)
        {
            this.DireccionDisparos = new Vector2(15, 0);
            this.graphicsDevice = graphicsDevice;
            Animacion = animation;
            Posicion = position;
            Activo = true;
            Vida = 100;

            // Proyectiles
            Proyectiles = new List<Projectil>();
            TexturaProyectil = content.Load<Texture2D>("laser");
            SonidoLaser = content.Load<SoundEffect>("sound/laserFire");

            DisparosFrecuencia = new TimeSpan[3];
            TiempoDeUltimoDisparo = new TimeSpan[3];
            shoots = new int[3];

            DisparosFrecuencia[0] = new TimeSpan(0, 0, 0, 0, 100);
            shoots[0] = 10;
            DisparosFrecuencia[1] = new TimeSpan(0, 0, 0, 0, 50);
            shoots[1] = 50;
            DisparosFrecuencia[2] = new TimeSpan(0, 0, 0, 0, 1);
            shoots[2] = 500;

            // Rastro de partículas :D
            var textures = new List<Texture2D>();
            textures.Add(content.Load<Texture2D>("spark"));
            particleEngine = new ParticleEngine(textures, new Vector2(400, 240));
        }