Esempio n. 1
0
  /* Application Listener */
  @Override
  public void create() {
    /* Test */
    Manager_Animation animation = new Manager_Animation();
    Manager_Behavior behavior = new Manager_Behavior();
    Manager_Object test_loader = new Manager_Object(behavior);
    Jukebox jukebox = new Jukebox();
    test_loader.load_data("data/test_object.dat");
    animation.load_animations("data/test_animation.dat");
    jukebox.load_music("data/test_music.dat");
    jukebox.load_sound("data/test_sound.dat");

    Manager_Texture textures = new Manager_Texture();
    textures.load_ids("data/test_drawable.dat");

    float base_width = BASE_HEIGHT * Gdx.graphics.getWidth() / Gdx.graphics.getHeight();
    float scalar = Gdx.graphics.getHeight() / BASE_HEIGHT;
    this.inputs = new GameInputs(scalar);
    this.renderer = new Renderer(3, scalar);
    Rectangle room_area = new Rectangle(0, 0, BASE_HEIGHT, base_width);
    this.room = new Room(room_area, this.renderer, test_loader, textures, animation, jukebox);

    this.room.spawn_object("player", new Vector2(50, 50));
    this.room.spawn_object("box", new Vector2(50, 50));

    /* Inputs */
    Gdx.input.setInputProcessor(this.inputs);
    this.inputs.add_controllable(this.room);
  } // END create