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?
Asked
Active
Viewed 997 times
1
-
Does this answer your question? https://scratch.mit.edu/discuss/topic/172652/ – Ruud Helderman Apr 13 '22 at 14:06
-
No im not trying to hide/show them, im trying to make it so that a sprite will display the number of the variable on it without having the variable box visible to make it look nicer – ChocolateChara Apr 13 '22 at 15:43
-
Thanks for the explanation. To customize the appearance of score on screen, use digit costumes. See griffpatch's "Awesome Number Counters" tutorial: https://www.youtube.com/watch?v=atMwy3UKc14 – Ruud Helderman Apr 13 '22 at 17:49
-
Alright ill be sure to look at it, thanks. – ChocolateChara Apr 14 '22 at 19:22
2 Answers
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".

Ayushman Das
- 23
- 5
-
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