Example #1
0
  private void Object_Touch() {
    object_touch.touched_essentials(fire_button, pause_button);
    pause = object_touch.pause();

    object_touch.touched_mirrors();

    rotate_mirrors = object_touch.rotate_mirrors();
    mirror_finger = object_touch.mirror_finger();
    mirrors_rotated = object_touch.mirrors_rotated();

    object_touch.touched_cubes();

    rotate_cubes = object_touch.rotate_cubes();
    cube_finger = object_touch.cube_finger();
    cubes_rotated = object_touch.cubes_rotated();

    object_touch.touched_colour_changers();

    rotate_colour_changers = object_touch.rotate_colour_changers();
    colour_changer_finger = object_touch.colour_changer_finger();
    colour_changers_rotated = object_touch.colour_changers_rotated();

    if (object_touch.fire_laser()) {

      if (laser_fired == false) {
        laser_fired = true;

        for (int i = 1; i <= number_of_cubes; i++) {

          if (rotate_cubes[i] == 0) {
            laser = new Laser();
            laser.position.set(cubes.get(i).position.x, cubes.get(i).position.y, 0);
            shoot_lasers(i);
            laser.direction(true, true);
          } else if (rotate_cubes[i] == 90) {
            laser = new Laser();
            laser.position.set(cubes.get(i).position.x, cubes.get(i).position.y, 0);
            shoot_lasers(i);
            laser.direction(false, false);
          } else if (rotate_cubes[i] == 180) {
            laser = new Laser();
            laser.position.set(cubes.get(i).position.x, cubes.get(i).position.y, 0);
            shoot_lasers(i);
            laser.direction(true, false);
          } else if (rotate_cubes[i] == 270) {
            laser = new Laser();
            laser.position.set(cubes.get(i).position.x, cubes.get(i).position.y, 0);
            shoot_lasers(i);
            laser.direction(false, true);
          }
          Gdx.app.log(Simulation.LOG, "green laser " + green_lasers.size() + " add");
        }
      }
    }

    if (pressed_back_button) {
      pause = true;
    }
  }
Example #2
0
  private void Pause_Actions() {
    object_touch.pause_check();
    back_to_menu = object_touch.back_to_menu();
    reset = object_touch.reset();
    pause = object_touch.pause();

    if (back_to_menu) {
      level.Game_Finished(0);
    }

    if (reset) {
      colour_changers.get(1).position.set(new Vector(10, 20, 0));

      mirrors.get(1).position.set(new Vector(0, -40, 0));
      mirrors.get(2).position.set(new Vector(50, 10, 0));
      mirrors.get(3).position.set(new Vector(0, 0, 0));
      mirrors.get(4).position.set(new Vector(-40, 10, 0));
      mirrors.get(5).position.set(new Vector(-60, 30, 0));
      mirrors.get(6).position.set(new Vector(-60, -20, 0));
      mirrors.get(7).position.set(new Vector(-70, 10, 0));
      mirrors.get(8).position.set(new Vector(60, 0, 0));
      mirrors.get(9).position.set(new Vector(-40, 40, 0));
    }
  }