Using physics to push objects around

Get help using Construct 2

Post » Tue Nov 26, 2013 12:48 am

Hi,

I have been trying to figure out how to get objects to push each other around when they collide, without overlapping each other. I am sure this can be done with the physics behaviour but I couldn't figure out how to get the objects to move at a set(constant) speed then stop, rather than accelerating and slowing down.

- Eventually the movement will be controlled by touch.
- Objects should slide along the walls rather than stopping.
- Objects should be able to push each other around.

I have included a cap file that shows how I would like the movement to be. Use arrow keys to control player:

capx

Any help on how I can get a similar style of movement using physics objects would be great... or how I can adapt the current cap file to include wall slide and pushing of objects.

Cheers
arontwose2013-11-26 00:51:02
B
8
S
3
G
1
Posts: 34
Reputation: 1,395

Post » Tue Nov 26, 2013 10:41 pm

@R0J0hound

Once again thanks :) after a little playing around I managed to use your example to get the result I was after.

I did have a few questions (but didn't want to derail your other thread)is it possible to have objects of varying sizes/radius?

Also I originally used the first created instance of p1 and stored its UID so I could then reference it to be used as the player. However I didn't know how to do a comparison between the first instance of p1 and all other p1 objects so that I can then make them avoid it.

In the end I had to add a separate player object, this isn't ideal it would be better if it was also included with the p1 collision events.

Use mouse to control the player, Cap file:

capx

Cheers
B
8
S
3
G
1
Posts: 34
Reputation: 1,395


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests