How do I display height a player has travelled?

Get help using Construct 2

Post » Thu Mar 12, 2015 3:31 pm

Hey. Was wondering how I'd use a text box to display how high a player has traveled. I could figure out how to display his current height, but I'm guessing it'd go back down if he goes down. Can anyone help me out? Thanks.
B
7
S
2
Posts: 60
Reputation: 604

Post » Thu Mar 12, 2015 4:19 pm

Don't use the height directly to display the text, but rather store it in a variable instead and only count up the variable, if the current height is higher than the value already stored. So no matter if the player goes down again, the variable will hold the highest point.
B
66
S
25
G
31
Posts: 446
Reputation: 18,702

Post » Thu Mar 12, 2015 5:05 pm

Thanks for the reply. Don't s'pose you could lay out what commands I'd need to use? I have no idea where to start. I was comparing the player's Y, but it was counting down.
B
7
S
2
Posts: 60
Reputation: 604

Post » Thu Mar 12, 2015 5:13 pm

Hi,
I would use two variables like New_Y and Orig_Y.
Player.Y > New_Y and Player.Y>Orig_Y -> store the Player.Y in New_Y
Your distance would be New_Y - Orig_Y
Hope will help.
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Thu Mar 12, 2015 6:36 pm

Thanks alot! I'll give it a go!
B
7
S
2
Posts: 60
Reputation: 604


Return to How do I....?

Who is online

Users browsing this forum: rap3dgp, Yahoo [Bot] and 35 guests