Door (blocking the goal)

Obj: door

Create a new door object - set the sprite to the basic red door (or choose another one in the "more doors" folder)

Make it solid; set "wall" object as the parent (so it inherits some stuff from the wall automatically, ie the person can't go through it).

disappear when diamonds gone

You want the door to disappear when all the diamonds are gone. So you have to test that object, that it's equal to zero.  

First add the Step event...

Then add the following actions (checking if any diamonds left)

  • Test Instance Count 
    ("diamonds" equal to 0)
  • Then in a start/end block, add the following actions:
    • Play sound (door)
    • Destroy Instance

Room

Add a few doors to block the flag.

Save your game and test it out - when you collect all the diamonds, the door should disappear.