Timing problem with the score

Discussion and feedback on Construct 2

Post » Fri Jun 09, 2017 8:12 am

Hello! I made a Flappy Bird like game and the score increases by one, whenever the bird and the pillar have the same x coordinate. If I make the pillar to appear every 1.2 seconds the score works fine. If I put it to 1.1 seconds, some pillars don't contribute to the score when the bird passes by them and if I put it to 1 second (which is what I want in the end), I get one point for the first pillar, but nothing for any other after that. If the time is more than 1.2 seconds the game also works fine. Why is this problem for smaller times? (I checked that the variable "score" itself doesn't work properly in the above mentioned cases, so it is not just a displaying problem) Thank you!
Posts: 57
Reputation: 545

Post » Fri Jun 09, 2017 8:38 am

Use an invisible trigger instead. Making a score that counts when the player is on the exact same x coordinate as another object is risky as it might miss that pixel if it moves too fast. So either make an invisible trigger in the hole of the pipes and add a score when the player collides with it or at least make the x coordinate check bigger.

For example is the player between pipe x-10 and pipe x+10 or something like that so it isn't checking for just one pixel. And make it only trigger once per pipe.

But an invisible trigger is a lot better and you should use that instead of ising unnecessary checks every tick.
Posts: 814
Reputation: 14,544

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests