//gameTime.millisec % _timeBetween == 0 //peut dépasser et donc pas ==0 ... public SlowBall(MovingObject parent, int pTimeBetweenProjectiles = 100, int pTtl = 3000) : base(parent, true, pTtl) { _sprite = SpriteManager.Shield1; _scale = SpriteManager.scaleRateSlowBall; _timeBetweenProjectiles = pTimeBetweenProjectiles; _speed = parent.Speed + new Microsoft.Xna.Framework.Vector2((float)Math.Cos(parent.RotationInRadians) * LASER_SPEED, (float)Math.Sin(parent.RotationInRadians) * LASER_SPEED); }
public Laser(MovingObject parent) { _speed = parent.Speed + new Microsoft.Xna.Framework.Vector2((float)Math.Cos(parent.RotationInRadians) * LASER_SPEED, (float)Math.Sin(parent.RotationInRadians) * LASER_SPEED); _position = parent.Position; _rotation = parent.RotationInDegrees; _sprite = SpriteManager.Laser; _scale = SpriteManager.scaleLaser; _origin.X = _sprite.Width / 2; _origin.Y = _sprite.Height / 2; }
public Laser(MovingObject parent, bool keepSpeed = true, float pttl = 400) { _lstToAdd = new List<MovingObject>(); _sprite = SpriteManager.Laser;// SpriteManager.Laser; _scale = SpriteManager.scaleLaser; _ttl = pttl; _speed = (keepSpeed ? parent.Speed : Vector2.Zero) + new Microsoft.Xna.Framework.Vector2((float)Math.Cos(parent.RotationInRadians) * LASER_SPEED, (float)Math.Sin(parent.RotationInRadians) * LASER_SPEED); _position = parent.Position; _rotation = parent.RotationInDegrees; _origin.X = _sprite.Width / 2; _origin.Y = _sprite.Height / 2; _shield.isWeapon = true; MAX_SPEED = 100; }
/// <summary> /// retourne la sous liste de tous les éléments nulls pour les enlever hors d'un foreach /// </summary> /// <param name="pLaser"></param> /// <returns></returns> private static bool FindNulls(MovingObject pLaser) { return pLaser == null; }
private static bool FindNotFade(MovingObject pObject) { return pObject.FadeTime <= 0; }
/// <summary> /// retourne la sous liste de tous les éléments morts pour les enlever hors d'un foreach /// </summary> /// <param name="pLaser"></param> /// <returns></returns> private static bool FindDeads(MovingObject pLaser) { return !pLaser.IsAlive; }
/// <summary> /// retourne la sous liste de tous les éléments alive d'une liste /// </summary> /// <param name="pLaser"></param> /// <returns></returns> private static bool FindAlive(MovingObject pLaser) { return pLaser.IsAlive; }