if (init == 0) { if (doorEntrance == -1) doorEntrance = image_index; init = 1; }