Exemple #1
0
  @Override
  public void create() {
    // TODO Auto-generated method stub
    super.create();

    assetManager = new AssetManager();
    GameHelper.getInstance().registerService(AssetManager.class, assetManager);

    loader = new MyAssetLoadingFacade(assetManager, new GdxInternalFileReader());

    JsonParser parser = new JsonParser();
    JsonArray arr =
        parser.parse(Gdx.files.internal("assets/entitiesInfo.json").reader()).getAsJsonArray();

    for (JsonElement elem : arr) {
      String path = elem.getAsString();

      loader.getLoadingDefFilePathes().add(path);
    }
    loader.getLoadingSpriteFilePathes().add("assets/spritesInfo.json");

    font = new BitmapFont();

    GameHelper.getInstance().registerService(ISpriteInfoMap.class, SpriteInfoMap.getInstance());
  }