jumping game score based on player movements

Get help using Construct 2

Post » Sun Jun 21, 2015 3:56 pm

Hi!

I would want to add value to my "playerDistance" variable, based on distance traveled by the player sprite, on Y axis. I found many threads or tutorials on this question but in my case, all these examples doesn't work because I need upward movements are added, and downward movements are subtracted from the value.

I'm very new to Construct 2 and I still don't know the expression i need to type in "add value" so that the value is based on movements of a sprite.

I hope my topic is clear :D

Thanks for reading and/or help!
B
7
S
1
Posts: 64
Reputation: 585

Post » Sun Jun 21, 2015 6:53 pm

I don't know if this will help you, but it's a idea.

Create a invisible tile, or object or anything at the start of the stage at the same position as the player. as the player moves you calculate the distance between the player and this object, the longer the distance bigger the score, and this will apply if the player is going up or down :D

And since you want the score to decrease if the player goes down, instead of setting the invisible object to the same position as the player's, set the object at the bottom of the screen. that way the player will get closer to it every time he goes down ;)
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Mon Jun 22, 2015 2:29 am

So obvious, so efficient...

As beginner, I still don't have the good state of mind :)

Thank you RayKi!
B
7
S
1
Posts: 64
Reputation: 585


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, ChesVCF, OBLIVION, shinkan, Solomon, yiuyiu6666 and 23 guests