Loading a High Score from a table and using a custom font

Hey guys,

I'm currently working on an endless running game and I've hit a stumbling block with the high score system.
I believe that having a table value of the high score saved is more reliable and I want to load said value to a place on the screen so the player can see it as they play.

However, where I've hit a snag is to load said table value with a custom font. I can do it with the standard text in GameSalad but when it comes to a custom font, I hit a brick wall. What I have are five actors [one for each digit], so what I want to happen is for each high score actor to load each individual digit.

Please help as I really need to get past this before I can continue further.

Thank you so much for your time.

Comments

  • JakeMorJakeMor Member, PRO Posts: 136
    I had to do this for my game Squares in Space it was really annoying...
    The easiest way to do this is to create 100,000 images of numbers ranging from 0 to 99,999. You want to name each image the number that it is, so like 87,543 would be named 87543.png. Then constrain the actors image to the score! It's that simple!

    If you have less than a millennium to get this done I would consider the method mentioned in the following video. I try to stay away from that method though, because my way uses just one actor which is soooo much easier to manage.


    =)) =)) =)) I HOPPE you were able to read through the sarcasm ahaha.
    Enjoy, PM me if you run into any more bumps in the road.
  • JakeMorJakeMor Member, PRO Posts: 136
    It's best to place the score all the way to the right of your screen so it stays aligned with the right of the screen. If you wanted to eliminate zeros do the following

    create a rule:
    if (high_score < self.div/10)
    then constrain self.alpha to 0
    otherwise constrain self.alpha to 1

    You don't need to do constrain but I always have because it usually gets rid of some bug that shows up at one point or another.
  • JakeMorJakeMor Member, PRO Posts: 136
    also, don't waste your time meticulously placing each actor. place these to change attribute functions in the number actor

    variables I will be using:
    x_starting (where the first numbers x should be)
    y_pos (y value of all numbers)
    x_spacing (spacing between each of the actors)

    constrain y to (y_pos)
    constrain x to (x_starting + (5-log(self.div))*x_spacing)
  • JakeMorJakeMor Member, PRO Posts: 136
    do you now understand the value of knowing your math ?!
  • MasakoXMasakoX Member Posts: 16
    Thank you Jake, so I take it you used the same method in the video and then added your own twist to it?

    I tried it and it seemed a little tricky.
Sign In or Register to comment.