Created
January 29, 2012 21:52
-
-
Save mduheaume/1700884 to your computer and use it in GitHub Desktop.
Difficulty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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