one thing more i have try in this
set "count stars" to max(stars, levels.At(currentLevel)) - min(stars, levels.At(currentLevel))
by doing this
suppose we play two time first we get 1 star and second time we get 3 star
when we get 1 star, 1 is added to "count stars"
when we get 3 star, then
max is 3 and min is 1 = 2 added to "count stars"
now updated "count stars" is 3
but problem comes when we play 3 times and we gets 1,2,3 stars
1st time we get 1 star
1 added "count stars"
2nd time we get 2 star
2-1= 1 more added to "count stars"
3rd time we get 3 star
3-1=2 adding to "count stars" this is the problem
because when we play 3rd time i want to deduct 2stars
but 2 is not "max" neither "min"
i don't know how to fix it
or may be their is any other solution available
or i m going wrong way