Sprites for Score display.

  • I want to be able to pick up certain items and add to the score when they are picked up.

    I also want the score to be able to be at least 3 characters long.

    I've found some things on the forums about using sprites to display scores (usually numbers 0 through 9)

    But none of them really explain things too well to help me understand what to do.

    Does anyone know how to change the score when its picked up, and also change each of the 3 sprites that's being used, as the score increases, or know of a good tutorial that explains it well?

    Any help is always appreciated, this has been kicking my butt for two days.

  • Something like this?

    spriteScore.capx (r117)

    The 'zeropad' expression makes sure you always have three numbers like 001 or 023 instead of just 1 and 23. Then you convert the score to a string with 'str' so you can use the 'mid' expression to pick a specific index of the string.

    The corresponding sprites change frames depending on what number the 'mid' expression returns. For the number 234, it would be 2 for the first sprite, 3 for the second and 4 for the last.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Awesome! You sir, are magic. And thank you for taking the time to explain it all, it definitely helps! Thank you again!

  • hey man! this will help me a lot too, because the appmobi doesnot accept text and settex to a var int.. have a bug.. a black screen when the game start...

    So, working with sprites for the score and not text/numbers will work...

    thanks man! Nimtrix

  • WOW! Doesn't seem to be a reason to ever use text for scores anymore...

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