Today I learned how to make the game restart when the player collided with the enemy. what i did: I add a piece of code into the collision event, if the player is colliding with the enemy , then the game will restart. I use " if(place_meeting(x,y,obj_player)" to tell gamemaker that if the enemy is colliding with my enemy, then run "if(obj_player.y < 0)" to say my player is colliding with the enemy at any part of the enemy. If so it will restart the game.
No comments:
Post a Comment