How do I add scores together

Get help using Construct 2

Post » Sat Apr 11, 2015 3:25 pm

Hi, In my game I want to add two scores together to come up with a grand total.
Like this, Player collects 50 points for killing the bad guys, Player collected 50 coins, I want those two added together to show a grand total of 100.
This grand total would always change depending on how many bad guys were killed and how many coins were collected.
Thanks !
B
4
Posts: 15
Reputation: 230

Post » Sat Apr 11, 2015 3:31 pm

If those numbers are global variables it would just be a case of creating a new variable GrandTotal and setting it to Coins+Points
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Apr 11, 2015 3:47 pm

This is what I have,
Global Variable TotalScore = 0
Global Variable Score = 0
Global Variable Coins =0

System > Everytick > TotalScore > Set text to "" &TotalScore = Score + Coins
B
4
Posts: 15
Reputation: 230

Post » Sat Apr 11, 2015 5:01 pm

If I understand correctly this should work to set the text:

System > Everytick > TotalScore > Set text to "Totalscore = "&Score + Coins

Easier would be
System every tick
- system set variable Totalscore = Score+Coins
- set text to "Totalscore = "& Totalscore
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: leandrogenske and 9 guests