コード例 #1
0
ファイル: Simulation.java プロジェクト: Grabot/Laser-Cube
  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));
    }
  }
コード例 #2
0
ファイル: Simulation.java プロジェクト: Grabot/Laser-Cube
  public void update(float delta) {
    Check_Touch();

    object_touch.initialize_variables(
        touch_distance_x,
        touch_distance_y,
        touched_down,
        pressed_back_button,
        fast_press,
        rotate_mirrors,
        rotate_cubes,
        rotate_colour_changers);

    if (pause) {
      if (ad_check == false) {
        main.ExternalHandler.showAds(true);
        ad_check = true;
      }
      Pause_Actions();
    } else {

      if (game_won) {
        if (ad_check == false) {
          main.ExternalHandler.showAds(true);
          ad_check = true;
        }
        check_finish();
      } else {
        if (ad_check == true) {
          main.ExternalHandler.showAds(false);
          ad_check = false;
        }
        Object_Touch();

        if (laser_fired) {
          Laser_Actions();
        } else {
          Movement(delta);
        }
      }
    }
  }
コード例 #3
0
ファイル: Simulation.java プロジェクト: Grabot/Laser-Cube
 public boolean touched_pause_button() {
   return object_touch.touched_pause_button();
 }
コード例 #4
0
ファイル: Simulation.java プロジェクト: Grabot/Laser-Cube
 public boolean reset_button_touched() {
   return object_touch.reset_button_touched();
 }
コード例 #5
0
ファイル: Simulation.java プロジェクト: Grabot/Laser-Cube
 public boolean back_button_touched() {
   return object_touch.back_button_touched();
 }
コード例 #6
0
ファイル: Simulation.java プロジェクト: Grabot/Laser-Cube
 public boolean continue_button_touched() {
   return object_touch.continue_button_touched();
 }
コード例 #7
0
ファイル: Simulation.java プロジェクト: Grabot/Laser-Cube
  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;
    }
  }