How do I make a top view object slide on wall/solid ?

Get help using Construct 2

Post » Tue Jan 06, 2015 11:33 pm

I didn't use the 8 Direction behavior and I made my own set of events. I only work with 8 directions (angles of 45°) and managed to get the sprite to slide on walls by adding collision detectors (Left and Right) ahead it. The issues is the following:
Image
At event 4 the collision is checked only with one solidWall, so when reaching a corner made from 2 solidWalls the event doesn't work how I would like.
How can i resolve this problem ?

Also is there any difference if I use Sprites or TiledBackgrounds for the solidWalls since both can cover a rectangle collision and support angle change ?
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Wed Jan 07, 2015 8:59 am

Do you mean you get to a Y shaped wall? If so why not put an invisble trigger at this point.
B
49
S
16
G
9
Posts: 1,098
Reputation: 11,222

Post » Wed Jan 07, 2015 5:36 pm

Here is a demo of my project:
https://dl.dropboxusercontent.com/u/187 ... index.html
[Arrows] - Move
[X] - Attack
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Thu Jan 08, 2015 2:16 pm

Anyone ?
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Thu Jan 08, 2015 5:05 pm

How about trying the Pushoutsolids behavior which is here.

http://c2rexplugins.weebly.com/rex_pushoutsolid.html

It might do what you want.
B
49
S
16
G
9
Posts: 1,098
Reputation: 11,222

Post » Thu Jan 08, 2015 8:24 pm

@TGeorgeMihai
For that you could add a pick all solidWall condition between the overlap conditions.
B
94
S
33
G
113
Posts: 5,354
Reputation: 73,269

Post » Fri Jan 09, 2015 12:22 am

@spongehammer
While Rex's plugins are very good, I prefer to not use 3rd party plugin unless is something that it can't be done in events (or is extremely complex to implement it in events) because updates sometimes break these plugins.

@R0J0hound
I've tried this before, but no luck ... I've attached a stripped down version of my .capx to see my events.
You do not have the required permissions to view the files attached to this post.
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Fri Jan 09, 2015 7:22 pm

@TGeorgeMihai
I mean putting the "pick all solidWall" in between you overlap conditions.
So instead of what you have now:
Code: Select all
PlayerAheadLeft is overlapping solidWall
PlayerAheadRight is overlapping solidWall


Do this for all 4 of your events:
Code: Select all
PlayerAheadLeft is overlapping solidWall
Pick all solidWall
PlayerAheadRight is overlapping solidWall
B
94
S
33
G
113
Posts: 5,354
Reputation: 73,269

Post » Fri Jan 09, 2015 11:04 pm

@R0J0hound
Thank you, it works exactly how I want just by editing the second group of conditions
Code: Select all
Else
PlayerAheadLeft is overlapping solidWall
Pick all solidWall
PlayerAheadRight is NOT overlapping solidWall

So in short after the PlayerAheadLeft is overlapping solidWall, reset the picked solidWall and then check again with PlayerAheadRight :D
B
49
S
15
G
6
Posts: 535
Reputation: 7,197


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests