How do I stop physics objects from shaking?

Get help using Construct 2

Post » Tue Apr 07, 2015 10:19 pm

I am making a game in which a bunch of blocks fall down into a grid. The player then has to make matches of 3 or more of like color, similar to Bejeweled or Candy Crush Saga.

When my blocks fall into the grid, I want them to accelerate and bounce, so I gave them a Physics behavior. They bounce nicely, but some of them will never come to a complete stop. They continue shaking and vibrating forever. The vibration is very small, maybe just 1 pixel up an down, but since the object never comes to a complete rest, the Physics behavior continues to be active forever.

Is there a way to stop the blocks from shaking?
B
6
Posts: 3
Reputation: 260

Post » Wed Apr 08, 2015 12:31 am

Have you tried using the physics actions Physics enabled/disabled?

Once the object reaches its destination grid space, or stops moving in Y values, or whatever have it set the objects physics to disabled and turn them back on again when they are needed to drop again.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
60
S
15
G
8
Posts: 620
Reputation: 8,972

Post » Wed Apr 08, 2015 4:29 am

You may want to look into moving the blocks around using a plugin like "Litetween" instead of using physics. It may be easier to control exactly the shapes, and be overall higher performance.
B
79
S
37
G
13
Posts: 957
Reputation: 15,389

Post » Wed Apr 08, 2015 7:30 am

Or you could use Chipmunk Physics behavior and set the sleep threshold.
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Wed Apr 08, 2015 7:32 am

Using physics for something like this does seem overkill, bullet-behaviour with gravity would do just about the same.
My guess is you should check your collision-polygons or set collision-mode to bounding box.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Apr 08, 2015 1:55 pm

Thanks for the useful responses! I will look into using non-physics alternatives to improve the performance of the falling blocks. Either that, or disable physics once each block reaches its destination.
B
6
Posts: 3
Reputation: 260


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 6 guests