Player jumping through solids

For questions about using Classic.

Post » Thu Sep 22, 2011 3:44 am

I'm currently trying to get a decent top-down engine working, and at the same time trying to learn the basics of construct.
Now, my problem: Whenever the player character overlaps a sprite of my "obstacle" -family, he stops and "bounces" (like he is meant to). Usually. But at some points he jumps through them instead. This only happens at certain points, not randomly. I'm using the custom movement behavior (since the other ones didn't do what I wanted them to).

Can anyone recognize this as an easy beginners problem or do we need a cap? (I would have uploaded it but it needs cleaning up to make sense).

Thanks.
B
7
S
1
G
4
Posts: 31
Reputation: 2,241

Post » Thu Sep 22, 2011 4:03 am

Can you post your cap? Easier to help that way.

I tried something similar with Custom Movement and got something working pretty sweet, though in the end I've opted to go for the 8 directional movement behavior.

The way I prevented the player from going through solids was by doing

If Player Overlaps Solid
--> Push Player out of Solid, Normal

Gives mostly wonderful results. The push out of object action is a custom movement action that you can find near the bottom.
B
56
S
20
G
7
Posts: 305
Reputation: 8,754

Post » Thu Sep 22, 2011 3:25 pm

Thanks for your quick reply.
I tried using various "push player out of..." -combos but with no success. It actually made things even more twitchy. The size of blocking objects does not seem to make any difference either.

I cleaned up the worst mess in the cap but it's still rather messy:


Edit: failed to post a proper link.
http://dl.dropbox.com/u/42681740/topview.capstillinthe90s2011-09-22 15:27:00
B
7
S
1
G
4
Posts: 31
Reputation: 2,241

Post » Thu Sep 22, 2011 4:01 pm

Are you using the animated player sprite itself for collisions? You should use a collision mask that's simply some rectangle.

Right now your colliding sprite is changing it's size depending on the animation frame it is on. That's no good and will cause all kinds of weirdness.

Either use a dummy sprite for collisions or the collision mask feature (go to the animator, right click, select launch explorer, there you will be able to open and edit the collision mask). Also be sure to use the bounding box collision mode where it applies (your walls for example).
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Thu Sep 22, 2011 5:37 pm

Hat of to you!
Solved it with a sphere shaped collision mask.
Not a very user friendly way of setting up mask though.
I never would have found it without help.
Anyway, all is well and everyone is happy. Thanks again.
B
7
S
1
G
4
Posts: 31
Reputation: 2,241


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest