Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 1 Support › flappybird score

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #6942

    Ed

    im not sure where i went wrong here. i created a flappybird clone and changed the graphics to my own right over the originals in photoshop so they would be in the same place. when i test my game, though, the “0” doesn’t appear when it needs to at “10”+. Instead, a “9” appears. For instance, the sequence is always 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 11, 12, 13, etc… anyone know why this happens?

    #6944

    David

    Hi edomich,

    This is a bug in the Numbers.qml! Thank you for reporting the bug. There is an easy fix and I have updated the flappy birds repository with this fix already!

    The problem was that the first number was deleted and the fragment was still shown. You can change the line 39 in Numbers.qml easily to get a working count.

    if((trailingZero && unit <= 0) || unit >= 10) {

    to

    if(number % 10 && ((trailingZero && unit <= 0) || unit >= 10)) {

     

    Cheers,

    David

    #6945

    Ed

    it works! thank you! ive been pulling my hair out trying to find what was wrong in the numbers qml. you guys are awesome.

    -ed

    #6978

    Ed

    David,

    I just realized that even though this seemed to fix the issue, there is still a problem. The same issue happens at the game over screen, under “score”. Do I need to apply the same fix to another line in the numbers qml?

    #6988

    David

    Hi edomich,

    it should fix the problem in all appearances of the Numbers element of course. I checked it and it does not appear for me in the gameover scene. At which score did it appear?

    Cheers,

    David

    #6997

    Ed

    After you crash, your current score, above best score, is the one that is affected. Same problem as before. Thanks for looking into it.

    Ed

    #6998

    David

    Hi Ed,

    I know that you mean the actual score above best score, but I need to know which number does the score has when the fragment appears (10, 100, 1, ect. ) because I could not reproduce the error until now.

    Cheers,

    David

    • This reply was modified 10 years, 1 month ago by  David.
    #7009

    Ed

    10

    #7015

    David

    Hi Ed,

    I have tried it again without the fix in Numbers.qml, score 10 is 19 in the score sign and also above the best score. When I apply the fix, it works in both cases – which should do, because it uses the same Numbers.qml file. Maybe you should try to make a clean build on desktop to be sure the Numbers.qml file is not in the shadow build.

    Cheers,

    David

    #7018

    David

    Hi Ed,

    I finally could reproduce the error. It only occurs when you reached a score of 10 and in the next round you reached a score of e.g. 2, then the score sign above score still is 1because 1 is set invisible in the Numbers.qml while the parent was invisible and it does not work. I’ll work on a workaround and let you know once I found a solutions.

    Cheers,

    David

    #7019

    David

    Hi Ed,

    I have updated the code on github and resolved the bug. Basically, the numbers are not set invisible and visible anymore, but they use an empty sprite instead. You have to update your spritesheet and add a few lines of code in Numbers.qml to get it working.

    Cheers,

    David

Viewing 11 posts - 1 through 11 (of 11 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded