Help with CustomMovement and collisions

Get help using Construct 2

Post » Sat Dec 28, 2013 5:24 pm

I have something like this (it's only a movement ripped from project)
capx file

There are two thing I'cant work out for last couple of days. Been trying different methods to do what I want but with no success. And finally I found out custom movement is more less best choice to go with.

1. There is a sprite "Leader" with custom movement behavior moving to mouse click position. It moves on empty area of Tilemap object.
It works fine until it collides with occupied tile.

What I want to do is to move "Leader" as close to mouse clicked position as possible, but don't know why it works only if sprite is colliding with tile on bottom. Like on image below

If I click somewhere on highlighted on blue area "Leader" will move on X (horizontally ;p) and stops really close to X position of mouse click.
Like I said it works only for this situation. If it collides with tile on top, left or right it will keep sliding all over the place.
Why it's happening?

2. For this You must toggle on event 1 and 9.
It's basically "Pin chain style.capx" from examples folder.
I'v added a custom movement behavior to Family1, so all "Follower" Sprites can move behind "Leader" and around solid tiles.
Now things are really interesting :D
"Follower" Sprites are indeed moving around obstacles as they should but "Leader" starts to jump all over the layout on every collision...

All I need is to "Leader" stop or slide to closest position of mouse click and "Follower" to move around solid tiles. It doesn't need to be perfect or pixel precise because "Leader" and "Followers" sprites are only bases of movement for other sprites that follow them with lag - I didn't include them in file cause they are irrelevant. So they can collide and overlap each other.

Any help will be appreciated, and thanks for reading :)
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,590
Reputation: 34,640

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, NyxoGe and 7 guests