Discuss Scratch

4lpha_Gaming
Scratcher
34 posts

Enemy Health bar

Hello can I get a help on a script how to make the life bars/health bars follow the cloned enemies the
Health bar that Is supposed to follow the enemy clones is also a clone how to make it? This is my project try taking a look (slimes are the monsters)

Last edited by 4lpha_Gaming (March 15, 2023 06:56:26)

--cherrykitty--
Scratcher
500+ posts

Enemy Health bar

I think Griffpatch made a YouTube tutorial for that, you can go search it up on YouTube. However, I believe that the best solution would be to make each individual monster a member of a larger class called monsters. Meaning there is a list containing information such as the location, health ect of each monster. If you would like the monsters to be clones you can use a “for this sprite only” variable to add an ID to each monster so each clone knows which member of the class they are, or I would personally prefer that each monster be re drawn every frame using the stamp function. I just find that system easier. That way, once every monster has been tagged in a central place, a health bar can be drawn above each one. Hope it helps!

There is more siggy after this! Highlight this and hit shift+down

Hi, I am –cherrykitty–!

Although I may seem new, I've actually been on the offline editor for some time already.

Feel free to ask me any questions on my profile!

I am working at a couple shops.


And I am now on a few collabs!
Online cloud quiz creator

Onscratch-a scratch social media
4lpha_Gaming
Scratcher
34 posts

Enemy Health bar

--cherrykitty-- wrote:

I think Griffpatch made a YouTube tutorial for that, you can go search it up on YouTube. However, I believe that the best solution would be to make each individual monster a member of a larger class called monsters. Meaning there is a list containing information such as the location, health ect of each monster. If you would like the monsters to be clones you can use a “for this sprite only” variable to add an ID to each monster so each clone knows which member of the class they are, or I would personally prefer that each monster be re drawn every frame using the stamp function. I just find that system easier. That way, once every monster has been tagged in a central place, a health bar can be drawn above each one. Hope it helps!
That's the other problem I already thought of that but I don't know how to use stamp function
4lpha_Gaming
Scratcher
34 posts

Enemy Health bar

4lpha_Gaming wrote:

--cherrykitty-- wrote:

I think Griffpatch made a YouTube tutorial for that, you can go search it up on YouTube. However, I believe that the best solution would be to make each individual monster a member of a larger class called monsters. Meaning there is a list containing information such as the location, health ect of each monster. If you would like the monsters to be clones you can use a “for this sprite only” variable to add an ID to each monster so each clone knows which member of the class they are, or I would personally prefer that each monster be re drawn every frame using the stamp function. I just find that system easier. That way, once every monster has been tagged in a central place, a health bar can be drawn above each one. Hope it helps!
That's the other problem I already thought of that but I don't know how to use stamp function
Is it just like a cloning? Or different because there's no tutorial of griffpatch about how to stamp something that needs to move
deck26
Scratcher
1000+ posts

Enemy Health bar

Stamping has to be refreshed every frame if you want to move things around - along with all other pen marks so if you're using pen for other things it can mean a lot of work. You can also only detect touching stamps by colour since there is no clone/sprite to detect. Doesn't mean stamping can't be useful within those limitations.

Powered by DjangoBB