how to make score & highscore

Discussion and feedback on Construct 2

Post » Fri Dec 30, 2016 10:36 pm

Message: vodka can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
hi,

im planning to make a highscore and score and show it to textbox that i made in "aftergame" layout. i already try to do that but it doesnt work. it doesnt show the high score and score in after game layout.

i hope you can help me out here :)

thanks in advance

this is my capx.

https://www.dropbox.com/s/iz1rkl7dhf1na36/GHPROJECT.capx?dl=0
B
4
Posts: 8
Reputation: 218

Post » Fri Dec 30, 2016 10:58 pm

I looked at your CAPX.

Your score texts are working but you are not changing the number because the game is not being played and adding anything to the score so it just keeps putting Zero in the text box over and over.

Add these two lines at the bottom of your events to see what I mean:

Image
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,830

Post » Sun Jan 01, 2017 1:05 pm

pseudo-code for assigning the hiscore to score

Code: Select all
score>hiscore - set hiscore to score

/////////////on game ended//////////

gameover = true - create text to position x, y
                              - set text to "score: "&score
                              - create text to position x, y+200
                              - set text to "hiscore: "&hiscore


x and y is the position you want it to show, you can pin or spawn to a score object then move that or depends on how you want them to animate or react.
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests