Esempio n. 1
0
  private void populateGlasses() {
    loadZwoptex();
    /** glass01 */
    this.glass01 = ZwoptexManager.makeSprite("glass01.png");
    this.glass01.setPosition(WYPoint.make(150.0f, 655.0f));
    addChild(this.glass01);
    this.glass01.setScale(0.3f);
    this.glass01.autoRelease();
    if (SharedData.getInstance().glassList.get(0).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass01.getWidth() - 25.0f, 40.0f);
      glass01.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass02 */
    this.glass02 = ZwoptexManager.makeSprite("glass02.png");
    this.glass02.setPosition(WYPoint.make(this.wySize.width - 150.0f, 655.0f));
    addChild(this.glass02);
    this.glass02.setScale(0.3f);
    this.glass02.autoRelease();
    if (SharedData.getInstance().glassList.get(1).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass02.getWidth() - 25.0f, 40.0f);
      glass02.addChild(sprite);
      sprite.autoRelease();
    }
    /** glass03 */
    this.glass03 = ZwoptexManager.makeSprite("glass03.png");
    this.glass03.setPosition(WYPoint.make(150.0f, 530));
    addChild(this.glass03);
    this.glass03.setScale(0.3f);
    this.glass03.autoRelease();
    if (SharedData.getInstance().glassList.get(2).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass03.getWidth() - 25.0f, 40.0f);
      glass03.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass04 */
    this.glass04 = ZwoptexManager.makeSprite("glass04.png");
    this.glass04.setPosition(WYPoint.make(this.wySize.width - 150.0f, 530.0f));
    addChild(this.glass04);
    this.glass04.setScale(0.3f);
    this.glass04.autoRelease();
    if (SharedData.getInstance().glassList.get(3).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass04.getWidth() - 25.0f, 40.0f);
      glass04.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass05 */
    this.glass05 = ZwoptexManager.makeSprite("glass05.png");
    this.glass05.setPosition(WYPoint.make(150.0f, 400));
    addChild(this.glass05);
    this.glass05.setScale(0.3f);
    this.glass05.autoRelease();
    if (SharedData.getInstance().glassList.get(4).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass05.getWidth() - 25.0f, 40.0f);
      glass05.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass06 */
    this.glass06 = ZwoptexManager.makeSprite("glass06.png");
    this.glass06.setPosition(WYPoint.make(this.wySize.width - 150.0f, 400.0f));
    addChild(this.glass06);
    this.glass06.setScale(0.3f);
    this.glass06.autoRelease();
    if (SharedData.getInstance().glassList.get(5).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass06.getWidth() - 25.0f, 40.0f);
      glass06.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass07 */
    this.glass07 = ZwoptexManager.makeSprite("glass07.png");
    this.glass07.setPosition(WYPoint.make(150.0f, 275));
    addChild(this.glass07);
    this.glass07.setScale(0.3f);
    this.glass07.autoRelease();
    if (SharedData.getInstance().glassList.get(6).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass07.getWidth() - 25.0f, 40.0f);
      glass07.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass08 */
    this.glass08 = ZwoptexManager.makeSprite("glass08.png");
    this.glass08.setPosition(WYPoint.make(this.wySize.width - 150.0f, 275.0f));
    addChild(this.glass08);
    this.glass08.setScale(0.3f);
    this.glass08.autoRelease();
    if (SharedData.getInstance().glassList.get(7).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass08.getWidth() - 25.0f, 40.0f);
      glass08.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass09 */
    this.glass09 = ZwoptexManager.makeSprite("glass09.png");
    this.glass09.setPosition(WYPoint.make(150.0f, 133.0f));
    addChild(this.glass09);
    this.glass09.setScale(0.3f);
    this.glass09.autoRelease();
    if (SharedData.getInstance().glassList.get(8).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass09.getWidth() - 25.0f, 40.0f);
      glass09.addChild(sprite);
      sprite.autoRelease();
    }

    /** glass10 */
    this.glass10 = ZwoptexManager.makeSprite("glass10.png");
    this.glass10.setPosition(WYPoint.make(this.wySize.width - 150.0f, 133.0f));
    addChild(this.glass10);
    this.glass10.setScale(0.3f);
    this.glass10.autoRelease();
    if (SharedData.getInstance().glassList.get(9).isLocked()) {
      Sprite sprite = Sprite.make(Texture2D.makePNG(R.drawable.lock_1));
      sprite.setScale(2.0f);
      sprite.setPosition(glass10.getWidth() - 25.0f, 40.0f);
      glass10.addChild(sprite);
      sprite.autoRelease();
    }
  }
Esempio n. 2
0
 /** LOAD THE ZWOPTEX TEXTURE */
 private void loadZwoptex() {
   ZwoptexManager.addZwoptex(
       "glasses", R.raw.glasses_texture, Texture2D.makePNG(R.drawable.glasses_texture));
 }