score tutorial

Get help using Construct 2

Post » Sun Feb 16, 2014 3:12 am

anyone have a tutorial capx to make a score? like in game score when playing,and then the score will be appear on game over layout.
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sun Feb 16, 2014 4:36 am

I am quite new to C2 myself, but I am currently making a simplistic game that uses a timer as a score.

The way you would do it however is using a variable:

> Define a variable and call it Score and default value to 0

> In your layout add a text string and call it ScoreDisplay with default text "0"

> Whenever an action increases the score, in your event you would go System > Add to (under variables section) and then add whatever score value you want to the variable.

> System > Every tick set the text value of ScoreDisplay to your variable.

This should get the job done.
B
6
S
1
Posts: 43
Reputation: 536

Post » Sun Feb 16, 2014 4:47 am

yes,i know that,but i want it appear on the another layout ex:GameOver layout.

i have try to make it on GameOver layout.
but,there's nothing happen with the score.

ex: ``Game``
Score = 5

``GameOver``
Score = 0
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sun Feb 16, 2014 7:29 am

Create a GameOverScore text in the GameOver layout by clicking the layout before you create the object.

Then, in your event to show the GameOver layout, set the GameOverScore text property to the Score value.

I hope this is what you meant. Else, maybe describe what you want in more details.
B
2
Posts: 4
Reputation: 158

Post » Sun Feb 16, 2014 7:37 am

you need to try my game to understand
http://www.scirra.com/arcade/example/12273/tibiame-fans-tibiame-hops
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sun Feb 16, 2014 10:22 am

help pleaseee
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Post » Sun Feb 16, 2014 10:33 am

@Hardty,
This is what I do,Use a global variable for the score.
Every tick-Set text of Score text in the game to Global variable Score

In the event sheet of gameover layout,Creat another global variable called Highscore.And make a text object called Highscore text in the gameover layout.
Event: Score>highscore ---> highscore set to score.Doc Ai2014-02-16 10:36:42
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sun Feb 16, 2014 10:35 am

Have you tried doing what Digitalsa suggested, it should work.

Without the code I can only guess that you are either:
Not setting the text to the value of the score var correctly.
Resetting the score var to zero at an inappropriate time eg before the restart button is pressed.Bertie Booster2014-02-16 10:37:41
There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Sun Feb 16, 2014 2:03 pm

I have created a capx. However, I do not have enough permission for posting a link here or even pm.

Send me your email address and I will send you a download link of the capx.
B
2
Posts: 4
Reputation: 158

Post » Mon Feb 17, 2014 6:32 am

Thanks everybody,now it can
~Everyone can make GAMEs~
B
56
S
12
G
1
Posts: 414
Reputation: 5,911

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests