How do I handle Is Overlapping with Custom Movement Speed

Get help using Construct 2

Post » Mon May 19, 2014 7:46 pm

I have two major issues that I simply cannot seem to figure out how to handle, but it's possible solving one might help me solve the other.

Note that I am NOT using Physics, this is a Top-Down view, similar to the SNES Link to the Past game.

On my Player object I am using CustomMovement to move the character around. So let's say if Left button is down then Set CustomMovement Horizontal speed to 200, and on release Stop. If the player overlaps a Wall sprite then I currently have the playerr push out of solid (Nearest).

The problem with using Push out of Solid (Nearest) is that Construct 2 apparently decides that this means to move the Y coordinate constantly down ever time it pushes onto the left side of the wall, the X coordinate moves to the right if pushing onto the bottom of the wall, and Y coordinate moves up if pushing onto the right side of the wall. This causes the player object to keep sliding around the object until it slides off the edge it's pushing against. Oddly enough, pushing onto the top of the wall doesn't have this problem.

I've attached an example capx of what I mean, showing what happens when you push into the left side of the wall.

Is there a way to handle this? My actual goal is to have the Player object "collide" with the wall and stop, however if I just use the CustomMovement Stop this prevents the player from ever moving again since he is still overlapping the wall object by 1 pixel so the event is always firing.

The couple "How do I" posts I've come across don't speak to this issue, so hopefully someone has figured this out and can help.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 3
Reputation: 181

Post » Tue May 20, 2014 2:03 am

I think using 8 direction would make things easier for you in this case , but if your adamant about custom movement i would play around with the stepping features of the behavior .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Tue May 20, 2014 11:35 pm

Ok, using 8-direction movement seems to be able to handle collisions a lot better. Thank you for the idea to swap to that instead.

Since the game is going to have a lot of parts where the player has to push another object, as well as enemies, is it better/easier to handle them with 8-direction movement or use Custom Movement for them? If I use custom movement I'll still have the issue with the objects being pushed sliding along solid objects. The enemies I am already handling via Custom Movement fairly well so far, but they are very basic enemies right now.
B
3
Posts: 3
Reputation: 181

Post » Tue May 20, 2014 11:50 pm

Read up on overlap at offset , used in conjunction with 8 direction i think it won't be difficult for pushing and or pulling , i have used it with 8 direction as well as platform movement .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Wed May 21, 2014 12:33 am

That worked perfectly! Thank you so much...you don't understand how frustrated I was getting with this and was almost at the point of just quitting thinking C2 couldn't handle this simple thing I was trying to do.

It's good to know it was just me not understanding all of C2s capabilities and how some of the behaviours/functions worked.

This has solved every single issue I had. Everything is now working exactly how I need it to and I can move on with the rest of my game :)
B
3
Posts: 3
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests