Need help with endless runner bug [SOLVED]

Just started using Construct 2? Post your questions here

Post » Sat Aug 23, 2014 12:36 pm

We have been working on a small endless runner to gift as a present for a little girl.
It mostly seems to work as intended, but when installed on a tablet the player seems to "teleport" to the right at random intervals.

I suspect that framerate might be causing a calculation problem in the "simulate platform pressing right" behavior, but I have no idea how to fix this.

To note is that when running the game on a tablet through LAN test, the issue does not seem to occur. (nor does it when testing in HTML through PC)

(APK was exported using crosswalk)

The capx can be found here; https://dl.dropboxusercontent.com/u/90939473/nyancatiHelp.capx
Last edited by Aquilax on Sun Aug 24, 2014 9:28 am, edited 1 time in total.
B
3
Posts: 3
Reputation: 206

Post » Sat Aug 23, 2014 1:10 pm

I experienced this bug on my pc on the first thing i made with c2. It would teleport off screen to the right so i ended up adding bound to layout for the player object... At the time i thought it could be related to the animated sprite collisions or the sprite size changed from the default in relation to the x axis correction code from the sample capx, but that probably isn't the case. I would be interested in how this can be fixed too.
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Sun Aug 24, 2014 9:28 am

I seem to have found and fixed the problem.

Originally I paused the player sprite's animation while not on a platform and setting the speed to 40 while on a platform.
It seems that it sets this speed every tick and additionally this seems to cause issues when the performance drops.

I assume it is in fact linked to what you mentioned regarding the sprites collisions during frame changes.

My fix was to remove the "pause animation" mechanic and the setting of the speed while on a platform.
The animation now unfortunately does not pause, but at least the player doesn't teleport anymore :)
B
3
Posts: 3
Reputation: 206

Post » Sun Aug 24, 2014 9:47 am

Oh cool! Have you tried to apply the same collision polygon to all animations and frames so that maybe you can keep the pause animation, but it doesn't detect changes collision-wise
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Tue Aug 26, 2014 7:23 am

Haven't tried that, but will do so tonight and give you an update :)
B
3
Posts: 3
Reputation: 206


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests