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(); } }
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"); }
public void ShootMissle(Missle missle) { _missles.Add(missle); }