You can either add this in with the other if-statement blocks, or start a new piece of code. In the example, it's going along with the other if-statement blocks that end the game.
Grab the light blue sensing block, "touching mouse-pointer?" Put this in the "if" part of the statement. Change "mouse-pointer" to the name of your obstacle sprite.