-1

Fist of all, I'm really sorry for my bad English and I pretty new to game maker .

I have 2 object in the game : obj_apple and obj_door( I unchecked visible box) my question is how can I make an obj_door visible in the room when all the obj_apple are destroyed?

Ti Gon
  • 11
  • 2
  • 4

2 Answers2

0

Object obj_door, Step event, place code (Add event -> Step -> Step -> tab Control -> section Code, first icon (Execute code)):

if !instance_exists(obj_apple) visible = true;
Dmi7ry
  • 1,777
  • 1
  • 13
  • 25
0

Another option, so you aren't making a check in every step event, is to put the check for the number of obj_apple in the destroy event of obj_apple.

For example, in the destroy event of obj_apple you would have:

if (instance_number(object_index) == 0) {
   with (obj_door) {
      visible = true;
   }
}
Andrew G.
  • 418
  • 3
  • 11