Physics, need help with stacks of objects

Get help using Construct 2

Post » Sat Dec 15, 2012 9:11 pm

Hi everybody,
I'm facing an issue while creating a phyisics-based puzzle game: I need to create some stacks of square (more generally rectangular) boxes.

The goal of the game is to destroy these boxes in a specific order to obtain things.. but this is OT

I observed that something does not behave as expected when stacks are built. This is my example CAPX done with a Beta r112 release:
Link to CAPX
text mode: https://www.dropbox.com/s/c4j63gjzn6e17bt/physicsStack.capx

As you can see, in the Layout 1, the first-left stack is self shaking while the geometry is the same of the second one.. Why?

In the Layout 2 I tried a trick: I set the "immovable" property when the speed of the Master block (the one with the well-known Metallica's "M") is lower than a treshold level.
Everytime a block is destroyed (or the master block is clicked) the physics is restored setting "movable" to every brick.
It is a work-in-progress trick that doesn't solve, because everytime the property "movable" is set, every block try to fall and then they gain its own position again.
I think every brick it feels itself as an infinite-mass object just for a short time when there is the 'immovable to movable' switch.

After this chatterbox post, the question is: does someone know a way to avoid the self-shaking behavior of a stack of objects built up that way?

Thanks in advance

Hatsu Sakura
B
21
S
5
G
5
Posts: 16
Reputation: 5,421

Post » Sat Dec 15, 2012 10:44 pm

Take a look at the catapult game demo that comes with Construct. You'll need to edit the settings regarding physics stepping.
B
37
S
9
G
7
Posts: 143
Reputation: 6,017

Post » Sun Dec 16, 2012 2:35 am

I moved the top block on the left stack up one pixel and it fixed it. It must have just been inside the other one causing a shake. It does shake a little bit, but stops pretty quick.
B
40
S
12
G
7
Posts: 603
Reputation: 7,646

Post » Sun Dec 16, 2012 10:20 pm

Dear all,
thank you both for your tips

@EncryptedCow your fast tip could solve the issue for the 1st screen of the game, but after destroying one brick the problem come back in its own original size. But I really appreciated your kindness and the time you spent opening my example and trying to find a solution. So, thank you a lot!

..and the winner is @basspenguin !
I had already played around with those settings trying to solve but I never put so high values (don't tell Ashley: I never opened the example you sohwed me.. )
So, putting higher values in the Physics engine, everything is now working fine!

Thank you all guys.
Have nice developings

Hatsu Sakura
B
21
S
5
G
5
Posts: 16
Reputation: 5,421


Return to How do I....?

Who is online

Users browsing this forum: Magistross and 2 guests