Slide against walls

Get help using Construct 2

Post » Mon Feb 10, 2014 9:08 pm

Hi all,

I tried searching for this but wasn't able to find a good solution. I'm having a problem where when my character runs into a wall, it stops and I have to change directions in order to move again. In particular it gets stuck up against diagonal walls. I would prefer if the character would continue to move, sliding against the wall. Can anybody help?

Here's an example- try going at the diagonal wall.
http://wearedoctors.net/game/uhoh.capx

Thank you!

-Steven
B
6
Posts: 8
Reputation: 520

Post » Tue Feb 11, 2014 3:07 am

Bumpity Bump?
B
6
Posts: 8
Reputation: 520

Post » Tue Feb 11, 2014 8:53 am

The computer thinks you want to move right, but there is something in the way so it is impossible to go right so it stops.
I guess what you should do is make events to tell the computer what you expect it to do when the player is pressing right, but going right is impossible.
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 » Tue Feb 11, 2014 1:58 pm

Hmm, lemme try some stuff along those lines. Do you know a way to detect the angle of an object being hit? Thank You!
B
6
Posts: 8
Reputation: 520

Post » Tue Feb 11, 2014 7:11 pm

@StevenShafer
The standard way to do it is re-implement the 8direction movement with the customMovement behavior and use the "push out solid closest" action.
https://dl.dropboxusercontent.com/u/5426011/examples21/slide3_customMovement.capx

Alternately the wall's solid behavior can be removed and the collision resolution can be done manually with events. It's complicated but gives a better result IMO.
https://dl.dropboxusercontent.com/u/5426011/examples21/slide3.capx
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests