Timing problem with the score

0 favourites
  • 2 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)