Games is getting over befoer the three lives have ended

i have set the life number to 3 but when i play the game and loose 1 life the games autoatically ends how can i fix this plss help

This is hard to answer without seeing your code, but a common problem is that the thing that caused a lost life is still happening, so you then immediately lose the remaining lives also.

For example, if the player lost a life due to touching an enemy, you need to move the character away, restart the level, or remove the enemy. Otherwise the sprites are still overlapping and you’ll lose a life each update cycle.