How do you make the life system work with lists and repetition?

I am developing a game in which the life system is activated every time there is a collision with the sprite. One life is decremented, and an image of the life icon should become invisible. I wrote the code. It is decrementing the RemainingLife variable, but the hearts always remain visible.


vida

The loop must always go from 1 to 3 ( or length of your list)

Also next time please switch the language to English before taking a screenshot

Taifun