Help with glitch where player falls through platform.

Get help using Construct 2

Post » Sat Aug 16, 2014 1:33 pm

Ive come across an odd glitch in my game where my player goes through platforms for some reason.

I had an issue with my autorunner where my player kept moving to the left when running off a platform, i managed to solve this by setting my players X position when they are falling (line 16). But after doing this, my player starts to go through platforms and i have no idea why.

When i delete the event i created, the glitch doesn't happen, it works as it should. I don't know why it's doing this and would appriciate help on fixing this issue.
You do not have the required permissions to view the files attached to this post.
B
5
S
2
Posts: 126
Reputation: 876

Post » Sat Aug 16, 2014 1:41 pm

Why?

As long as player is falling it's position will be set to x=138, so even if there are platforms there..
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 » Sat Aug 16, 2014 1:46 pm

Because as i mentioned, i had a problem where my player moves to the left when they run off the platform. By setting the position, as i've done, it seem to solve that issue but now i have the glitch.

You can try my capx and delete line 16 and you'll notice that my player moves to the left when running off the platform...
B
5
S
2
Posts: 126
Reputation: 876

Post » Sun Aug 17, 2014 2:28 pm

Anyone? I'm really stumped by this as i don't know why this is happening...
B
5
S
2
Posts: 126
Reputation: 876

Post » Mon Aug 18, 2014 4:01 pm

Sorry to bump this but can anyone help? Can this be classed as a bug if it can't be fixed?
B
5
S
2
Posts: 126
Reputation: 876

Post » Tue Aug 19, 2014 11:45 am

Hi tomhaiger, it's not a bug, it was actually because you set the x position of the player to always be at a certain point. The problem happens when you hit the side of the box. Instead of falling down, the X position is enforced, so it moves through the box since the condition to restart the level has not yet been met.

I've edited your file a little with a little comment, so hopefully this helps.

https://www.dropbox.com/s/17h639fi6mwc1 ... dited.capx
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Tue Aug 19, 2014 2:17 pm

@rekjl Thank you for your response, i've tried the capx but because the level restarts when the player overlaps the platform, it kind of renders the game unplayable as there is no way of telling when it could happen and it defeats the purpose of the game.

I'm glad it's not a bug but could you help me find a workaround for this please? Could you perhaps fix it so that it worked as before but without the glitch and the player moving back to the left when falling (which i mention in the first post that i kind of fixed with Line 16)
B
5
S
2
Posts: 126
Reputation: 876

Post » Tue Aug 19, 2014 3:03 pm

No problem tomhaiger. I used a variable (I think I use variables a little too much for almost anything :P ) to let the game know when I want to set the x position of the player. So once the player overlaps with the block, we use a variable to turn off the x position so that the player is free to fall. Also, I set another OR condition for the restart, where if the player's X position is under 0 (behind to the left outside the screen) it restarts as well.

Here's the capx. Hope this helps.

https://www.dropbox.com/s/8mtabn6w2qawd ... ited2.capx
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Tue Aug 19, 2014 7:40 pm

You can never use too much variables :)

Thanks but although it's a little better, I still get instances where the player skips through some platforms, and also when two platforms are close together that you can just run onto the other, if the platform you're running onto is just slightly raised than the one you're on and you run onto it (hope that made sense), either the game ends (restarts) or it skips through it.
B
5
S
2
Posts: 126
Reputation: 876

Post » Wed Aug 20, 2014 3:28 pm

Just reading through the forums, i was wondering using a invisible rectangle sprite with no animations with the Platform movement would work?

I've read a few people that have recommened this for platform games, but would this work for an autorunner?

If so, should i just create an invisible block and transfer all behaviours from the player to the block and replace the player with the block in the events?
B
5
S
2
Posts: 126
Reputation: 876

Next

Return to How do I....?

Who is online

Users browsing this forum: Bobbyneal100, mikehive, newt, tinhofiel and 46 guests