private float GetEnemySoundPos(ShooterGameObject e) { var x = e.GetX(); var w = e.GetWidth(); var halfwidth = ((float)SystemMain.Width / 2); var finalfloat = 0.0f; x += ((float)w / 2); var zeropoint = SystemMain.Width / 2; if (x > ((float)w / 2)) { x -= halfwidth; finalfloat = (x / halfwidth); } else { finalfloat = (x / halfwidth); finalfloat = Math.Abs(1 - finalfloat) * (-1); } return(finalfloat); }
public void AddEnemy(ShooterGameObject e) { _total++; _enemies.Add(e); }
private float GetEnemySoundPos(ShooterGameObject e) { var x = e.GetX(); var w = e.GetWidth(); var halfwidth = ((float)SystemMain.Width/2); var finalfloat = 0.0f; x += ((float)w/2); var zeropoint = SystemMain.Width/2; if(x>((float)w/2)) { x -= halfwidth; finalfloat = (x/halfwidth); } else { finalfloat = (x / halfwidth); finalfloat = Math.Abs(1 - finalfloat)*(-1); } return finalfloat; }
public void KillEnemy(ShooterGameObject e) { _enemies.Remove(e); }