How to track only horizontal speed!

Get help using Construct 2

Post » Sun Dec 04, 2011 6:34 am

Heyo! I'm new to Construct and I love it so far!

However, I've got a question...

I have an object with a Platform behavior. I'd like to make it so when the object has a horizontal speed below 0 (meaning it moves left) the sprite mirrors left. When the horizontal speed is above 0 (meaning it moves right) the sprite unmirrors to the right. I have the actions down just fine, but it seems the conditional for the object is just comparing it's SPEED, which also applies to itself vertically.

How do I track an objects HORIZONTAL speed?

Thanks in advance!
B
1
G
1
Posts: 1
Reputation: 527

Post » Sun Dec 04, 2011 8:34 am

New Condition > System > Compare 2 values > Object.Platform.VectorX
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Sun Dec 04, 2011 7:09 pm

This isn't normally done by the VectorX, usually it's done by keypresses instead:

+ On left pressed
-> Set mirrored

+ On right pressed
-> Set not mirrored
Scirra Founder
B
397
S
236
G
88
Posts: 24,427
Reputation: 194,568

Post » Wed May 09, 2012 3:48 pm

@Ashley

Is there a problem with using the vectorX idea.
I have a problem with using the keys pressed technique, when pressing both it is possible to have the sprite walk backwards.

Regards Traeve
B
5
S
1
Posts: 15
Reputation: 1,107

Post » Wed May 09, 2012 3:53 pm

Yes, VectorX should work as well.
Scirra Founder
B
397
S
236
G
88
Posts: 24,427
Reputation: 194,568


Return to How do I....?

Who is online

Users browsing this forum: beohs, brunopalermo and 11 guests