Display score as tick marks?

Started by Paul Franzen, Sun 08/04/2012 03:04:07

Previous topic - Next topic

Paul Franzen

Hey, here's a quandary: Does anyone know if there's a way to display score as a series of tick marks? (i.e., 1 is one vertical slash; 3 is three vertical slashes; 5 is four vertical slashes and one horizontal slash?; etc.)

I set up a GUI to display score on what sort-of looks like a chalkboard, and I was thinking that using tick marks to display the score itself would really help sell the image. But...I can't think of a way to actually do that, unless there's a font that could display numbers that way (and even if there was, it probably wouldn't work when you got to two-digit numbers, since they don't have their own unique symbols.)

Thoughts, anyone?
The Beard in the Mirror (formerly testgame) - Out now on Steam! http://store.steampowered.com/app/385840
Other games I've worked on: http://paulmfranzen.com/games/

Khris

All you do is count from 1 to score and draw the marks using two sprites.
Something like this:

Code: ags
function DrawScore() {
  int i = 1;
  int x = 45, y = 40;
  DrawingSurface*ds = Room.GetDrawingSurfaceForBackground();
  while (i <= score) {
    if ((i/5)*5 == i) {
      ds.DrawImage(x - 30, y + 10, HORIZONTAL_MARK_SPRITE);
      x += 15;
    }
    else {
      ds.DrawImage(x, y, VERTICAL_MARK_SPRITE);
      x += 8;
    }
    if (x > 280) {
      x = 45;
      y += 40;
    }
    i++;
  }
}

Paul Franzen

Wow, thanks! I'd assumed it wouldn't be possible. I'll play around with this and see if I can't get it to work!
The Beard in the Mirror (formerly testgame) - Out now on Steam! http://store.steampowered.com/app/385840
Other games I've worked on: http://paulmfranzen.com/games/

Khris

Why wouldn't it be possible? It's just images drawn on the background, really basic stuff.

Btw, the numbers I chose are pretty arbitrary guesstimates, you'll need to change them depending on the size of your mark sprites, the position of the score board, etc.

Paul Franzen

I dunno! I don't have a ton of experience working with AGS yet--I've set up a couple simple screens with basic interactions, but nothing more complicated than that. I guess I just didn't realize that scores could be represented by images; I assumed it was text only.
The Beard in the Mirror (formerly testgame) - Out now on Steam! http://store.steampowered.com/app/385840
Other games I've worked on: http://paulmfranzen.com/games/

Khris

I see, well, the score is simply a number, and it's up to you how you represent that number. In theory, you can make the player's character sprite appear the fatter the more score points they gain, or increase the number of raindrops falling.

SMF spam blocked by CleanTalk