Physics Question: Hard Walls

Discussion and feedback on Construct 2

Post » Fri Oct 26, 2012 2:24 pm

I have a box with 4 walls in the centre of the screen.

Inside the box i have 10 marbles.

I have applied physics to all marbles. The walls are set to unmoveable.

I can move the marbles with the mouse as I enabled Drag & Drop on the marbles and they react great. however if i apply a large impulse or move the mouse a lot, the marbles PASS THROUGH the walls.

I wand to make the walls HARD and IMPENETRABLE. What physics attributes should I apply to the walls?

Thanks a lot

B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Fri Oct 26, 2012 3:53 pm

Try enabling the 'bullet' property in the physics behavior for the fast moving objects.

Note from the Physics Basics tutorial most behaviors conflict with Physics, so if you are dragging and dropping objects through walls then there's not much that can be done about that - you'll have to move the objects towards the mouse using forces instead of the behavior.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,498

Post » Fri Oct 26, 2012 4:00 pm

i removed the drag and drop and i have seen no effect, so the drag & drop is not causing any problem.

what was causing the problem is that one of the wall masks was moving out of place with an ill-placed sine behaviour!

thanks for helpbjadams2012-10-26 16:11:30
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Sat Oct 27, 2012 1:01 am

If you apply a huge impulse, there's not much you can do to prevent warping. It's a side-effect of the game loop running only 60 times/second.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Oct 27, 2012 2:59 pm

I would make a new Event that turns off the Drag and Drop when the mouse touched the Walls ...you could even use an invisible helper sprite set to Mouse.x, Mouse.y position every tick....
The Helper Sprite "Buffers" the effect .and could even be dynamically scaled depending on where your mouse was on the screen, by using areas which affect scale..etc...you know..a dynamic real time..scaling of effect...IN the Military its called Scalar technology...if it works on a small level you just scale it up!!

What I mean is apply the Drag and drop disabling event to the invisible Sprite Helper..
so that it turns off well before the marble gets beyond the Walls..

So the Helper not the marble or the mouse triggers the Drag and drop disabling event..


Does that make sense?

Helpers are good for everything...

This is what I mean
http://s12.postimage.org/nx8zktxe5/This_is_what_I_mean.jpgmystazsea2012-10-27 15:02:12
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
29
S
11
G
8
Posts: 312
Reputation: 7,333

Post » Sat Oct 27, 2012 7:30 pm

thanks
B
30
S
6
G
4
Posts: 108
Reputation: 5,602


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests