Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // untested, may contain errors.
- // suggestion for score & stars awarded for number of moves + time taken
- int maxScore = 10000;
- int numStars = 3;
- float movesFactor = 1f/(movesTaken-minMoves); // range from 0-1
- float timeFactor = Mathf.InverseLerp(maxTimeAllowed,timeForThreeStars,timeTaken); // range from 0-1
- int score = Mathf.RoundToInt(maxScore * movesFactor * timeFactor);
- int stars = Mathf.RoundToInt(score*numStars / (float)maxScore);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement