public void Animate() {
        icon = images[states[number]];

        if (number != 0) {
            return;
        }

        if (states[0] == 0) {
            states[0] = 1;
            for (int a = 1; a < 10; a++) {
                states[a] = 0;
            }
        }

        boolean flag = true;
        for (int a = 0; a < 10; a++) {
            if (states[a] != 2) {
                flag = false;
            }
        }

        if (flag) {
            Portal ptl = new Portal("ROEndGame.lvl", true, true);
            level.materials.addElement(ptl);
            room.SetMaterial(10, 9, ptl);
        }

        if (states[0] == 2) {
            Date now = new Date();
            if (now.getTime() > timeout.getTime()) {
                states[0] = 1;
                for (int a = 1; a < 10; a++) {
                    states[a] = 0;
                }
            }
        }

    }