1

I am making a Undertale-Based game on Scratch, and I am trying to make a health counter that shows how much health you have. I could always make the variable viewable but I want it to fit in with the game and not stick out like a sore thumb. I've seen other games like Candy Clicker do this but I don't know how they make the sprite display the variable. Does anybody know how?

ChocolateChara
  • 187
  • 1
  • 16

2 Answers2

1

To do a sprite counter similar to Candy Clicker, you would need to use clones. You need to create a sprite with costumes for 0-9 numbers. Then you would need to have that sprite clone itself for however many digits you want to display, let's say 3, and then set its costume to the letter number of the variable that the clone's digit corresponds to. I'm not great at explaining stuff like this, so that might have seemed a bit complicated, so the short version is you need to create sprites that display the digits from costumes. I have created a demo at https://scratch.mit.edu/projects/677633446/editor with comments in the code.

DT_
  • 36
  • 4
0

Just put the variable in a "Say Block" and put that in a "Forever Loop".

  • I am aware you can do that but that's not exactly what im looking for. Im looking for something similar to Candy Clicker's counter. – ChocolateChara Apr 15 '22 at 14:11