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
23
S
8
Posts: 115
Reputation: 2,640

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
92
S
32
G
107
Posts: 5,280
Reputation: 69,971

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
23
S
8
Posts: 115
Reputation: 2,640

Post » Tue Dec 13, 2016 6:35 pm

B
48
S
9
G
10
Posts: 200
Reputation: 8,258

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
23
S
8
Posts: 115
Reputation: 2,640


Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, atmas, tarek2 and 29 guests