public void loadSplashScreen() {
   BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
   splashTextureAtlas =
       new BitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
   splashTextureRegion =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           splashTextureAtlas, activity, "splash.jpg", 0, 0);
   splashTextureAtlas.load();
 }
Пример #2
0
  public void loadSplashResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    splashTA = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256);

    splashTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            splashTA, activity, "splash12.png", 0, 0);

    splashTA.load();
  }
  public void loadLoadingResources() {
    if (loadingTextureAtlas != null) {
      loadingTextureAtlas.load();
      return;
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/loading/");
    loadingTextureAtlas =
        new BitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    loadingTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            loadingTextureAtlas, activity, "background.png", 0, 0);
    loadingTextureAtlas.load();
  }
  private void loadAboutGraphics() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/about/");
    aboutTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);

    aboutBackgroundTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            aboutTextureAtlas, activity, "background.jpg");

    try {
      aboutTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 1));
      aboutTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
  private void loadMainMenuGraphics() {

    if (menuTextureAtlas != null) {
      menuTextureAtlas.load();
      return;
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    menuTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);

    menuBackgroundTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "background.jpg");
    buttonAboutTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_help.png");
    buttonExitTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_exit.png");
    buttonNewGameTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_new.png");
    buttonOptionsTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_options.png");
    buttonHighScoreTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_high.png");
    buttonMultiplayerTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_multiplayer.png");

    try {
      menuTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 1));
      menuTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
 private void loadChalkFont() {
   if (chalkFontTextureAtlas != null) {
     return;
   }
   FontFactory.setAssetBasePath("font/");
   chalkFontTextureAtlas =
       new BitmapTextureAtlas(activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
   chalkFont =
       FontFactory.createStrokeFromAsset(
           activity.getFontManager(),
           chalkFontTextureAtlas,
           activity.getAssets(),
           "ChalkPaint.ttf",
           50,
           true,
           Color.WHITE,
           2,
           Color.WHITE);
   chalkFontTextureAtlas.load();
   chalkFont.load();
 }
 private void loadBlackFont() {
   if (gameFontTextureAtlas != null) {
     return;
   }
   FontFactory.setAssetBasePath("font/");
   gameFontTextureAtlas =
       new BitmapTextureAtlas(activity.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
   blackFont =
       FontFactory.createStrokeFromAsset(
           activity.getFontManager(),
           gameFontTextureAtlas,
           activity.getAssets(),
           "font1.ttf",
           50,
           true,
           Color.BLACK,
           2,
           Color.BLACK);
   gameFontTextureAtlas.load();
   blackFont.load();
 }
Пример #8
0
  public void loadMenuResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    ResourceManager.playBitmapTextureAtlas =
        new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
    ResourceManager.optionsBitmapTextureAtlas =
        new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
    ResourceManager.scoresBitmapTextureAtlas =
        new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
    ResourceManager.instructionsTextureAtlas =
        new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
    ResourceManager.exitBitmapTextureAtlas =
        new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);

    // load the button texture regions
    mMenuBgTextureAtlas =
        new BitmapTextureAtlas(
            activity.getTextureManager(),
            (int) camera.getWidth(),
            (int) camera.getHeight(),
            TextureOptions.DEFAULT);

    mBgTexture =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mMenuBgTextureAtlas, activity, "image.jpg", 0, 0);
    ResourceManager.newGameTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            ResourceManager.playBitmapTextureAtlas, activity, "new_game.PNG", 0, 0);
    ResourceManager.optionsTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            ResourceManager.optionsBitmapTextureAtlas, activity, "settings1.png", 0, 0);
    ResourceManager.quitTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            ResourceManager.exitBitmapTextureAtlas, activity, "exit.PNG", 0, 50);
    ResourceManager.scoresTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            ResourceManager.scoresBitmapTextureAtlas, activity, "menu_reset.png", 0, 0);
    ResourceManager.instructionsTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            ResourceManager.instructionsTextureAtlas, activity, "instructions.PNG", 0, 0);

    ResourceManager.optionsBitmapTextureAtlas.load();
    ResourceManager.playBitmapTextureAtlas.load();
    ResourceManager.scoresBitmapTextureAtlas.load();
    ResourceManager.instructionsTextureAtlas.load();
    ResourceManager.exitBitmapTextureAtlas.load();
    ResourceManager.mMenuBgTextureAtlas.load();
  }
  private void loadHighScoreGraphics() {
    if (recordTextureAtlas != null) {
      recordTextureAtlas.load();
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/highscore/");

    recordTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 512, TextureOptions.BILINEAR);
    recordBackgroundTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            recordTextureAtlas, activity, "background.png");

    try {
      recordTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 0));
      recordTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
  private void loadGameTypeGraphics() {
    if (gameTypeTextureAtlas != null) {
      gameTypeTextureAtlas.load();
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/gametype/");
    gameTypeTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);

    backgroundGameTypeTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTypeTextureAtlas, activity, "background.png");

    starGoldTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTypeTextureAtlas, activity, "goldStar.png");
    starWhiteTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTypeTextureAtlas, activity, "whiteStar.png");
    awesomeTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTypeTextureAtlas, activity, "awesome.png");
    lockTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTypeTextureAtlas, activity, "lock.png");
    playButtonTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTypeTextureAtlas, activity, "playButton.png");

    try {
      gameTypeTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(1, 1, 1));
      gameTypeTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
  private void loadGameGraphics() {

    if (gameTextureAtlas != null) {
      gameTextureAtlas.load();
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/game/");
    gameTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);

    backgroundGameTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "background.png");
    buttonOkTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "button_ok.png");
    buttonNoTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "button_no.png");
    lifeBarBorderTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "bar_border.png");

    playerRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            gameTextureAtlas, activity, "blackFish.png", 2, 1);

    try {
      gameTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 1));
      gameTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
Пример #12
0
  public void loadGameResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    SoundFactory.setAssetBasePath("sfx/");
    MusicFactory.setAssetBasePath("sfx/");
    condomTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);
    chickenTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);
    tabletTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);
    waterTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);
    garlicTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 32, 32);
    pineappleTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);
    alcoholTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 32, 64);
    blueTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256);
    redTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256);
    razorTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256);
    winTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 1024, 512);
    lossTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 1024, 512);
    pauseTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);
    cigarreteTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);
    soyaTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 32, 16);
    bonusTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 64, 64);

    // create the texture regions of the different Sprites
    condomTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            condomTextureAtlas, activity, "condom2f.png", 0, 0);
    chickenTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            chickenTextureAtlas, activity, "chichen_final.png", 0, 0);
    tabletTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            tabletTextureAtlas, activity, "tab.png", 0, 0);
    garlicTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            garlicTextureAtlas, activity, "garlicf.png", 0, 0);
    pineappleTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            pineappleTextureAtlas, activity, "pinef.png", 0, 0);
    waterTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            waterTextureAtlas, activity, "water.png", 0, 0);
    alcoholTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            alcoholTextureAtlas, activity, "waragi.png", 0, 0);
    blueTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            blueTextureAtlas, activity, "blue3.png", 0, 0);
    redTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            redTextureAtlas, activity, "red2.png", 0, 0);
    razorTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            razorTextureAtlas, activity, "razor.png", 0, 0);
    winTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            winTextureAtlas, activity, "win.png", 0, 0);
    lossTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            lossTextureAtlas, activity, "loss.png", 0, 0);
    cigarreteTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            cigarreteTextureAtlas, activity, "cigaret5.png", 0, 0);
    soyaTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            soyaTextureAtlas, activity, "sayaf.png", 0, 0);
    bonusTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            bonusTextureAtlas, activity, "health.png", 0, 0);
    pauseTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            pauseTextureAtlas, activity, "pause.png", 0, 0);

    mBackgroundTexture =
        new BitmapTextureAtlas(
            engine.getTextureManager(),
            (int) camera.getWidth(),
            (int) camera.getHeight(),
            TextureOptions.DEFAULT);
    mBgTexture =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mBackgroundTexture, activity, "game_background.jpg", 0, 0);

    // scoreFontTexture = new BitmapTextureAtlas(engine.getTextureManager(),
    // 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    // FontFactory.setAssetBasePath("font/");
    // ResourceManager.mFont = FontFactory.createFromAsset(scoreFontTexture,
    // engine.getTextureManager(),
    // "Droid.ttf", FONT_SIZE, true, Color.BLACK);
    ResourceManager.mFont =
        FontFactory.create(
            engine.getFontManager(),
            engine.getTextureManager(),
            256,
            256,
            Typeface.create(Typeface.DEFAULT, Typeface.BOLD),
            FONT_SIZE);

    // Load our "sound.mp3" file into a Sound object
    try {
      mGameTapSound =
          SoundFactory.createSoundFromAsset(engine.getSoundManager(), activity, "tap.mp3");
      badFoodSound =
          SoundFactory.createSoundFromAsset(engine.getSoundManager(), activity, "plast.mp3");
    } catch (IOException e) {
      e.printStackTrace();
    }
    // Load our "music.mp3" file into a music object
    try {
      gameMusic =
          MusicFactory.createMusicFromAsset(engine.getMusicManager(), activity, "welcome.mp3");
    } catch (IOException e) {
      e.printStackTrace();
    }

    ResourceManager.mFont.load();
    ResourceManager.mBackgroundTexture.load();
    condomTextureAtlas.load();
    chickenTextureAtlas.load();
    tabletTextureAtlas.load();
    pineappleTextureAtlas.load();
    waterTextureAtlas.load();
    alcoholTextureAtlas.load();
    garlicTextureAtlas.load();
    blueTextureAtlas.load();
    redTextureAtlas.load();
    razorTextureAtlas.load();
    winTextureAtlas.load();
    lossTextureAtlas.load();
    pauseTextureAtlas.load();
    cigarreteTextureAtlas.load();
    soyaTextureAtlas.load();
    bonusTextureAtlas.load();
  }