Improving my grading system

Get help using Construct 2

Post » Thu Feb 20, 2014 1:28 pm

Hello... I want to improve my grading system..
At the end of the level, If the player has:

*between 300-500 points, he receives 1 star
*between 500-1000 points, he receives 2 stars
*over 1000 points, he receives 3 stars

So far, I have this code:
Image


It works well... But I need to improve it:
(1) include the lower limit (300).. When the player scores 250 points, he receives no stars.
(2) Add the upper limit (1000), not like I did it with other values (1000000 in my case)

Thanks for your help. :D
B
6
Posts: 11
Reputation: 291

Post » Thu Feb 20, 2014 1:48 pm

Unless you have complete different actions depending on the number of stars, you want to call a function here. This function would be called, giving it the star number as a parameter. It would then act by executing those actions and using its parameter if needed.

Also, you can structure your events like this : ScreenCapture
Less sub-events, easier to modify and improve/use.
B
17
S
8
G
4
Posts: 461
Reputation: 6,157

Post » Thu Feb 20, 2014 1:53 pm

Here is something similar I did a bit ago for another question

https://dl.dropboxusercontent.com/u/143 ... ction.capx
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Thu Feb 20, 2014 2:01 pm

You can use multiple conditions, so in one event do
Score > 300
Score <=500
That gives 1 star. Etc. Since you won't have a score of both <= 500 AND > 500, you also don't need those else statements.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Thu Feb 20, 2014 2:08 pm

updated capx to make it slightly more relevant

https://www.dropbox.com/s/po8eedc5nyy4p ... score.capx
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Thu Feb 20, 2014 4:49 pm

thanks... If I stuck somewhere, Ill write in this thread.. Thanks, again!
B
6
Posts: 11
Reputation: 291

Post » Thu Feb 20, 2014 8:46 pm

Sorry for the double post.. The second project from @RamPackWobble helped me.. Thanks a lot.. You can close this thread. :D
B
6
Posts: 11
Reputation: 291

Post » Thu Feb 20, 2014 9:39 pm

You could try an equation to calculate the number of stars also, something like this for example
stars = floor(score/500)

score < 500 = 0 star
500>score<1000 = 1star
1000>score<1500 = 2stars
1500> score = 3 stars
B
11
S
4
G
1
Posts: 272
Reputation: 1,643


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests