예제 #1
0
        internal void OnCollision(Missle missle)
        {
            if (Health == 0)
            {
                return;
            }

            Health = Math.Max(0, Health - 2);
            _sprite.SetColor(new Killer1.Color(1, 1, 0, 1));

            if (Health == 0)
            {
                OnDestoryed();
            }
        }
예제 #2
0
        public void FireMissle()
        {
            if (_missleRecoveryTime > 0)
            {
                return;
            }
            else
            {
                _missleRecoveryTime = MissleRecovery;
            }

            Missle missle = new Missle(_missleTexture);

            missle.SetScale(0.8, 0.8);
            //missle.SetColor(new Color(0,0,1,1));
            missle.SetPosition(_sprite.GetPosition() + _gunOffset);
            _bulletManager.ShootMissle(missle);
            _soundManager.PlaySound("missle");
        }
예제 #3
0
 public void ShootMissle(Missle missle)
 {
     _missles.Add(missle);
 }