This site requires JavaScript, please enable it in your browser!
Greenfoot back

how do I program hearts that act as lives ?

I wanna add Hearts that function as Lives into my game and I have done that by creating three different heart actors (Named Heart, Heartt and Hearttt) but now I want those Hearts to disappear if my Player touches an object (in this Case a bomb) and reappear when my player touches another object (in this case a strawberry). Can anyone help me with how I could make it so if my player touches a bomb one heart disappears and if my player touches a strawberry one heart reappears ?? (This post is genuinely my last try, I have looked all over the internet how to do this and have not found an answer and I am very new to coding so I have basically no knowledge sooo if anyone knows how to do this or has even the smallest suggestion please share!!!)
danpost danpost

2026/5/27

#
shouldijuststartprayingatpquestion wrote...
I wanna add Hearts that function as Lives into my game and I have done that by creating three different heart actors (Named Heart, Heartt and Hearttt) but now I want those Hearts to disappear if my Player touches an object (in this Case a bomb) and reappear when my player touches another object (in this case a strawberry). Can anyone help me with how I could make it so if my player touches a bomb one heart disappears and if my player touches a strawberry one heart reappears ?? (This post is genuinely my last try, I have looked all over the internet how to do this and have not found an answer and I am very new to coding so I have basically no knowledge sooo if anyone knows how to do this or has even the smallest suggestion please share!!!)
You may want to check out my Value DisplayTutorial scenario. It has a section dedicated to this type of displaying.
You need to login to post a reply.