Advertisement
duck

suggestion for score & stars awarded for moves + time taken

Mar 29th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. // untested, may contain errors.
  2. // suggestion for score & stars awarded for number of moves + time taken
  3.  
  4. int maxScore = 10000;
  5. int numStars = 3;
  6.  
  7. float movesFactor = 1f/(movesTaken-minMoves); // range from 0-1
  8.  
  9. float timeFactor = Mathf.InverseLerp(maxTimeAllowed,timeForThreeStars,timeTaken); // range from 0-1
  10.  
  11. int score = Mathf.RoundToInt(maxScore * movesFactor * timeFactor);
  12. int stars = Mathf.RoundToInt(score*numStars / (float)maxScore);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement