# no gravity movement and angles

Get help using Construct 2

### » Mon Sep 23, 2013 3:31 am

Hi,

How come CustomMovement.MovingAngle has negative and positive numbers and Object.Angle is all positive numbers?

I can't compare the two without some sort of conversion.

The only time it would work is if the player is going straight down.. both variables are 90.. but going up one is 270 and the other is -90.

When my player reaches a certain speed I want to stop the acceleration, unless they change direction. So I want to add:
IF CustomMovement.MovingAngle != Player.Angle

I'm trying to emulate no gravity type physics. So you can only go a certain max speed in one direction, however in the opposite direction, increasing acceleration would slow your speed.

I feel like there's an easier way to do this that I am overlooking...

thanks..
B
103
S
35
G
16
Posts: 1,227
Reputation: 17,198

### » Tue Sep 24, 2013 1:59 am

I figured it out incase anyone else wants to know.

I found the anglediff function which successfully compares 2 angles even if one angle is 0-360 and the other one is 0-180 (and negative numbers)

So I compare:

anglediff(floor(Player.CustomMovement.MovingAngle),floor(Player.Angle))
B
103
S
35
G
16
Posts: 1,227
Reputation: 17,198