예제 #1
0
  public IngameScreen() {

    Res.ingame = this;

    chunks = new ArrayList<Chunk>();
    marker = new ArrayList<Marker>();

    Chunk chunk = new Chunk(0, 0);
    chunks.add(chunk);

    player = Res.player;
    // set player to the center of the world
    player.setX(-player.getWidth() / 2);
    player.setY(-player.getHeight() / 2);
    player.setRotation(-90);

    // get preferences
    gameZoom = Preferences.getFloat("gameZoom", 1f);

    cameraRect = new Rectangle();

    // get textures
    point_start = Res.atlas.findRegion("point_start");
    point_end = Res.atlas.findRegion("point_end");
    background = Res.atlas.findRegion("background");
    lifeborder = Res.atlas.findRegion("life_border");
    lifefill = Res.atlas.findRegion("life_fill");
    switchWeapons = Res.atlas.findRegion("switchWeapons");

    marker.add(new Marker(0, 0));
    Controllers.addListener(new ControllerControlls()); // TODO only when screen visib?
  }