How to make a Score Screen Layout?

Get help using Construct 2

Post » Mon Oct 28, 2013 9:50 pm

Hi,
How can i make a Score Screen Layout in the end of each stage like in Super Mario Bros and Sonic games?
I want to use math expressions to show the player his total score and his rank which depends of his total score. But i dont know how to do this...

The Expression is:

TotalScore = (Score * number of items collected) / HealthLost

Obs: Score and number of items collected are global variables.

Example:

If the TotalScore is 4000~5000+ an S letter is shown right below the Rank text.
If the TotalScore is 3000~3999 an A letter is shown right below the Rank text.
If the TotalScore is 2000~2999 an B letter is shown right below the Rank text.
If the TotalScore is 1000~1999 an C letter is shown right below the Rank text.Decade2013-10-28 21:52:47
B
3
Posts: 6
Reputation: 216

Post » Mon Oct 28, 2013 10:41 pm

Soo.. where is the problem? You've got everything you need already in your text. Just use the numbers as conditions to determine which symbol you wanna display.

a condition could look like
totalscore greater or equal 4000: create rank s
totalscore greater or equal 3000 AND totalscore less than 4000: create rank a

or a shorter solution:

When you display the score layout:
create rank (sprite with c, b, etc in frames 1, 2, ..., 0 is empty)
set totalscore = score*numberitems/healthlost
set localvar = floor(totalscore/1000)

- localvar > 4 : set rank frame number = 4
- else: set rank frame number = localvar

or if you wanna use animations:

- localvar > 4 : set rank animation = "a4"
- else: set rank animation = "a"&str(localvar)mindfaQ2013-10-28 22:44:10
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Oct 28, 2013 10:49 pm

Thanks for help. I got the idea for rank now :)
But i still dont know how to use or implement those math expressions on the layout...
How can i use math expressions with global variables and variables? Decade2013-10-28 22:56:23
B
3
Posts: 6
Reputation: 216

Post » Mon Oct 28, 2013 11:18 pm

just type them...
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue Oct 29, 2013 2:23 am

I tried but dont work. The math expressions dissappear and leave the box text blank
B
3
Posts: 6
Reputation: 216

Post » Tue Oct 29, 2013 12:06 pm

Where do you try to type them (which dialog) and what do you exactly type.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Wed Oct 30, 2013 6:12 pm

I typed on layout event sheet
Function On "TotalScore" >> Function Set return value to (Score*ItemQuantity)/HealthLost
and Function On "HealthLost" >> Function Set return value to Totalhealth-health
B
3
Posts: 6
Reputation: 216

Post » Wed Oct 30, 2013 9:15 pm


it should work... (ofc should never divide by 0)
although you don't necessarily need to put stuff like this in a function (if the calculation is the only action you wanna execute)mindfaQ2013-10-30 21:16:22
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Fri Nov 01, 2013 7:44 pm

I'll try this. Thanks! :D
B
3
Posts: 6
Reputation: 216

Post » Sat Nov 02, 2013 1:49 am

I tried what you told but i dont know why isnt working.
The values on screen dont change...


Decade2013-11-02 01:59:31
B
3
Posts: 6
Reputation: 216

Next

Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948, Yahoo [Bot] and 55 guests