Пример #1
0
 public void InitilizeBullets(Texture2D bulletTexture)
 {
     for (int i = 0; i < bullets.Length; i++)
     {
         bullets[i] = new Bullet();
         bullets[i].IsDead = true;
         bullets[i].Texture = bulletTexture;
     }
 }
Пример #2
0
        public void Shoot()
        {
            if (_AttackTimer.Finished == false)
                return;
            _AttackTimer.Reset();

            if (Input.KeyPress(_Ability1))
            {
                Bullet bullet = new Bullet();
                bullet._Sprite = _BulletSprite;
                bullet._Position = _Position;
                bullet._Acceleration = 100.0f;
                bullet._Direction = new Vector2(0, -1);
                bullet._VelocityMax = 20.0f;
                Managers.EntityManager.Instance.Instantiate(bullet);
            }
        }