Help with player collision

Get help using Construct 2

Post » Wed May 27, 2015 4:16 pm

in addition to @LittleStain 's solution, I would have the Waypoint.X expire after a certain amount of time..or something like that..

because if you Touch/Click way across the screen, when you come off the wall (after sliding down it) the player goes rushing over. So maybe OnOverlap Wall you shut off the Waypoint.X lerp logic..
B
88
S
29
G
14
Posts: 1,158
Reputation: 15,011

Post » Wed May 27, 2015 4:27 pm

Added a pixel to the player displacement to prevent player being stuck and added setting waypoint.x to player.x to prevent the rushing..

Re-upload at the same adress..
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 May 27, 2015 4:57 pm

Thanks @jobel @LittleStain that's fixed everything but the wall jump issue. I've made a quick gif: http://i61.tinypic.com/1zd7iq9.gif

Really have to time it right for that to happen mind you but its still possible. Though it does only work when I move the mouse off the screen so possibly only accepting an x coord between a certain size?
Need help finding the right look for your game? I can help! hayes2D.com
B
28
S
5
Posts: 173
Reputation: 2,126

Post » Wed May 27, 2015 5:06 pm

well the further you click away the faster the player moves along the X... so it must be redrawing it inside the wall since you aren't using a behavior like CustomMovement, meaning it's happening before the other behavior logic.

so yes limiting the x to a certain amount may work.
B
88
S
29
G
14
Posts: 1,158
Reputation: 15,011

Post » Wed May 27, 2015 5:22 pm

That makes sense, the % that it jumps with the lerp becomes enough to clip through a wall when the WaypointX and player.X become so large. I'll also give custom movement an experiment too as I've not tried it yet. Though it doesn't work with solids does it?

Thanks again, hopefully I'll have this nailed soon!
Need help finding the right look for your game? I can help! hayes2D.com
B
28
S
5
Posts: 173
Reputation: 2,126

Post » Wed May 27, 2015 5:31 pm

Re-uploaded with clamped waypointX..
Maximum distance to player in my example 100px..
Doesn't seem to go through any walls anymore..
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 May 27, 2015 5:39 pm

Works like an absolute charm. Thanks so much!!
Need help finding the right look for your game? I can help! hayes2D.com
B
28
S
5
Posts: 173
Reputation: 2,126

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests