Skip to content

Instantly share code, notes, and snippets.

@mduheaume
Created January 29, 2012 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mduheaume/1700884 to your computer and use it in GitHub Desktop.
Save mduheaume/1700884 to your computer and use it in GitHub Desktop.
Difficulty
/*
Add this in main Controller. It bases difficulty on p1Points but we can change this method to
set difficulty however we want.
*/
public int Difficulty {
get {
return p1Points>1?p1Points:1;
}
}
/*
Add this in turret controller. calculates the shoot rate based on Difficulty in main
*/
float GetShootRate() {
return Mathf.Min(((float)Mathf.Pow(this.main.Difficulty, 2.0f))/50f, 0.5f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment