how to make sure that when you hit an obstacle, the game does not end? maybe just reset the player speed to 0?
there are plenty of ways to achive that: e.g. use a timer event in order to disable the collision-detection for a few seconds or make the player invulnerable for a short period of time