How do I Measure my Jump Hight?

Get help using Construct 2

Post » Tue Dec 13, 2016 4:15 pm

Alright this is straight forward,

My character jumps off of the ground and lands again back on the ground.

What I want to do is Measure how far away from the ground my character has jumped then display that in text.

How can I do this?
B
25
S
9
Posts: 116
Reputation: 2,797

Post » Tue Dec 13, 2016 6:13 pm

Here's one way:

global number starty=0
global number miny=0

on jump
--- set starty to player.y
--- set miny to player.y

on landed
--- set text to starty-miny

every tick
--- set miny to min(miny, player.y)
B
100
S
38
G
134
Posts: 5,556
Reputation: 85,325

Post » Tue Dec 13, 2016 6:29 pm

R0J0hound wrote:Here's one way:

global number starty=0
global number miny=0

on jump
--- set starty to player.y
--- set miny to player.y

on landed
--- set text to starty-miny

every tick
--- set miny to min(miny, player.y)

Yeah I copied what you said and it only showed up as a 0 in the text once.
B
25
S
9
Posts: 116
Reputation: 2,797

Post » Tue Dec 13, 2016 6:35 pm

B
48
S
10
G
10
Posts: 200
Reputation: 8,322

Post » Tue Dec 13, 2016 6:46 pm

luisgmolina wrote:image:
Image

Here the example:
https://drive.google.com/file/d/0B9uHUU ... sp=sharing


Thanks man that worked :D
B
25
S
9
Posts: 116
Reputation: 2,797


Return to How do I....?

Who is online

Users browsing this forum: Drago_18, Kyatric and 8 guests