Adding score

Get help using Construct 2

Post » Wed Dec 28, 2011 3:22 pm

How do I add score?

I have 3 levels and I want a counter that adds 1 to the score when I complete a level.

And I don't know how to make it visible... in other words, I can't make it into a text somewhere on the screen.
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Wed Dec 28, 2011 3:33 pm

Add a global variable, Call it score or something appropriate,

Then every tick add 1 to score,

Or on collision add 100 to score,

If you want to add a random number to the score,

on collision with(Object) -

add to score, int(random(100))
or between two numbers, int(random(50,100)) will return a whole number between 50 and 100
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Wed Dec 28, 2011 3:34 pm

But I want to see a text where it says Score: (my score) and everytime I complete a new level it should add 1 to (my score)
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Wed Dec 28, 2011 3:36 pm

System every tick, ScoreText.set Text "Score :" & Score
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Wed Dec 28, 2011 3:38 pm

Check out page 6 & 7 of the tutorial.
http://www.scirra.com/tutorials/37/beginners-guide-to-construct-2/page-6

It walks you through on how to make a global variable, and create a HUD to display it in your game.
B
20
S
5
G
5
Posts: 66
Reputation: 4,515

Post » Wed Dec 28, 2011 3:42 pm

So now I have a text saying score but how do I get the global number inside the second textbox?
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Wed Dec 28, 2011 3:43 pm

ahh well thanks :)
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Wed Dec 28, 2011 4:04 pm

Did you figure it out?

"score" & Score - "Score :" adds the text, and the & Score is what shows the score, Score is the global variable..
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Wed Dec 28, 2011 4:06 pm

hehe well I made it thanks a lot but now my problem is that the score is random... haha well I better find my problem soon ;)
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Wed Dec 28, 2011 4:07 pm

well solved that problem too :D Thanks everyone for taking time :)
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Next

Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble, Evanetot and 25 guests