//----------------------//------------------------//

        public GameProjectile(Texture2D texture, Vector2 initialPosition, float dx, float dy, int damage, ProjectileSubject subject)
        {
            _sprite = new Sprite(texture);
            _sprite.OriginNormalized = Vector2.Zero;
            _sprite.Position         = initialPosition;
            _position     = initialPosition;
            LastPosition  = _position;
            _acceleration = new Vector2(dx, dy);
            _damage       = damage;
            _subject      = subject;
            _rand         = new Random();
        }
 public void CreateProjectile(string name, Vector2 position, int dx, int dy, int damage, ProjectileSubject subject)
 {
     _projectiles.Add(new GameProjectile(_projectilesTextures[name], position, dx, dy, damage, subject));
 }
示例#3
0
 public void CreateProjectile(string name, Vector2 position, int dx, int dy, int damage, ProjectileSubject subject)
 {
     if (name == "common")
     {
         _shotSe.PlaySafe();
     }
     _projectiles.Add(new GameProjectile(_projectilesTextures[name], position, dx, dy, damage, subject));
 }
 public void CreateProjectile(string name, Vector2 position, int dx, int dy, int damage, ProjectileSubject subject)
 {
     if (name == "common")
         SoundManager.PlaySafe(_shotSe);
     _projectiles.Add(new GameProjectile(_projectilesTextures[name], position, dx, dy, damage, subject));
 }
        //----------------------//------------------------//

        public GameProjectile(Texture2D texture, Vector2 initialPosition, float dx, float dy, int damage, ProjectileSubject subject)
        {
            _sprite = new Sprite(texture);
            _sprite.OriginNormalized = Vector2.Zero;
            _sprite.Position = initialPosition;
            _position = initialPosition;
            LastPosition = _position;
            _acceleration = new Vector2(dx, dy);
            _damage = damage;
            _subject = subject;
            _rand = new Random();
        }