How do I make a ball slow down quicker.

Get help using Construct 2

Post » Sun Mar 08, 2015 10:26 pm

I'm having trouble figuring out how to make a ball slow down quickly. I do have angular damping at a 1 and that isn't slow enough. I don't want to change linear damping at all. The problem is it takes forever for the X velocity of the ball to hit zero. When the X velocity is between -0.99999... to 1 or 1 to 1.99999... it is almost unrecognizable from the human eye that it is moving. So i want the ball to completely stop when it is in between those numbers. Any Ideas?
B
24
S
9
G
3
Posts: 18
Reputation: 3,137

Post » Mon Mar 09, 2015 1:06 am

You can check if the xVelocity is between -1 and 1 with two conditions.

Basically this:
Sprite.Physics.velocityX > -1
Sprite.Physics.velocityX < 1

Now there are a lot of conditions that can be used to do this. A basic one is the system->compare condition. And if you want it to work with more than one instance of sprite add a "for each sprite" condition above the two conditions.
B
84
S
27
G
69
Posts: 4,918
Reputation: 49,028

Post » Mon Mar 09, 2015 9:36 pm

Your idea worked but there is a problem, it only works in one direction. When the ball hits a wall the X velocity will go straight to 0 and mess it up. any suggestions
B
24
S
9
G
3
Posts: 18
Reputation: 3,137

Post » Tue Mar 10, 2015 12:50 am

Those two conditions need to be in the same event block for it to work. The only way it would go straight to zero is if only one of the conditions were used.
B
84
S
27
G
69
Posts: 4,918
Reputation: 49,028

Post » Tue Mar 10, 2015 4:49 am

Thanks for all the help. I finally figured it out
B
24
S
9
G
3
Posts: 18
Reputation: 3,137


Return to How do I....?

Who is online

Users browsing this forum: GamerGon and 0 guests