// DECLARING METHODS: PROJECTILES /// <summary> /// Shoots a Projectile to the Player's Position /// </summary> protected void Shoot() { Vector2f vEnemyShootingDirection = sEntity.Position + new Vector2f(0, 25); vEnemyShootingDirection = Utilities.VectorRotation(fAnglecopy / fNumberToCorrect, vEnemyShootingDirection, sEntity.Position); pProjectile = new EnemyProjectile(fAngle, sEntity.Position, vEnemyShootingDirection, 1); lProjectile.Add(pProjectile); SoundManager.PlaySpecificSound(Sounds.Shot); }
/// <summary> /// Reduces Health and Restarts Regenerate Timer of the Player if hit by EnemyProjectile /// </summary> /// <param name="iProjectile">Projectile that Collision with Player is checked</param> /// <param name="Damage">Damage inflicted to the Player if hit</param> /// <returns></returns> protected bool PlayerProjectileCollision(EnemyProjectile iProjectile, uint Damage) { Vector2f b = MainMap.GetStartCharacterPosition() + new Vector2f(25, 25); if (Utilities.DistanceBetweenVectors(iProjectile.vEntityPosition, b) <= 25) { Player.ReduceHealth(Damage); Player.RestartRegenerateTimer(); return(true); } return(false); }