Day 16

What I did today

Today was a short day and i didn't get much done. I tried to implement Lives to the game. In the Create Event i put 

life = 5; 

Then in the step event i put 

if life <= 0 {
       show_message("You Died")
       game_restart
}

if (place_meeting(x,y,obj_death)) {
       life -= 1;
       room_restart
}

Here in the create event i made a variable and gave it value of 5. Then in the step event I said that if your life is smaller or equal to 0 to display message "You Died" Then restarts the game. Then I said if my player is touching obj_death to take one life off and to restart the room i'm currently in. This doesn't work because whenever i restart the room it resets all my lives back to 5. So i'm trying to figure out how to make it so that its persistent even when the room resets.

Tomorrow I will try to make a way to keep the lives when it restarts the room.

No comments:

Post a Comment