Package com.pointcliki.dizgruntled.rez

Examples of com.pointcliki.dizgruntled.rez.MonolithPID


  private void updateAnimation() {
    AnimatedSprite sprite;
    if (fReached) {
      sprite = new MonolithANI(GruntzGame.resourceManager().rez().file("GAME/ANIZ/CHECKPOINTFLAGSET", "ani"), "GAME/IMAGEZ/CHECKPOINTFLAG").sprite();
    } else {
      MonolithPID pid = GruntzGame.resourceManager().pid("GAME/IMAGEZ/CHECKPOINTFLAG/FRAME001");
      sprite = new AnimatedSprite(new Image[] {pid.image()}, new Vector2f[] {pid.offset()});
    }
   
    if (fAnimation != null) fAnimation.cleanup();
    fAnimation = sprite;
    addChild(fAnimation);
View Full Code Here


    };
    fProperties = new LogicProperty[]{group};
  }
 
  public static AnimatedSprite editorIcon(JSONObject object) throws JSONException {
    MonolithPID pid = GruntzGame.resourceManager().pid("GAME/IMAGEZ/CHECKPOINTFLAG/FRAME001");
    return new AnimatedSprite(new Image[] {pid.image()}, new Vector2f[] {pid.offset()});
  }
View Full Code Here

    // TODO Auto-generated method stub

  }
 
  public static AnimatedSprite editorIcon(JSONObject object) throws JSONException {
    MonolithPID pid = GruntzGame.resourceManager().pid("GRUNTZ/IMAGEZ/GRUNTPUDDLE/FRAME001");
    return new AnimatedSprite(new Image[] {pid.image()}, new Vector2f[] {pid.offset()});
  }
View Full Code Here

    };
    fProperties = new LogicProperty[]{text};
  }
 
  public static AnimatedSprite editorIcon(JSONObject object) throws JSONException {
    MonolithPID pid = GruntzGame.resourceManager().pid("GAME/IMAGEZ/HELPBOX/FRAME001");
    return new AnimatedSprite(new Image[] {pid.image()}, new Vector2f[] {pid.offset()});
  }
View Full Code Here

      Image image = new Image(512, 512);
      int n = 0;
      for (int i: fMapping) {
        String j = i + "";
        while (j.length() < 3) j = "0" + j;
        MonolithPID pid = GruntzGame.resourceManager().pid(fArea + "/TILEZ/ACTION/" + j);
        if (pid != null) {
          image.getGraphics().drawImage(pid.image(), n % 16 * 32, n / 16 * 32);
        }
        n++;
      }
      image.getGraphics().flush();
      fCount = n;
View Full Code Here

    } else {
      image = "POWERUPZ/" + item;
    }
    if (item.startsWith("SECRET")) image = item;
   
    MonolithPID pid = GruntzGame.resourceManager().pid("GAME/IMAGEZ/INGAMEICONZ/" + image + "/FRAME001");
    return new AnimatedSprite(new Image[] {pid.image()}, new Vector2f[] {pid.offset()});
  }
View Full Code Here

 
  public MonolithPID pid(String ref) {
    if (!fPIDs.containsKey(ref)) {
      MonolithFile f = rez().file(ref, "pid");
      if (f == null) return null;
      fPIDs.put(ref, new MonolithPID(f));
    }
    return fPIDs.get(ref);
  }
View Full Code Here

    return fPIDs.get(ref);
  }
 
  public MonolithPID pid(String ref, GruntPalette p) {
    if (!fPIDs.containsKey(ref + p.toString())) {
      MonolithPID img = pid(ref);
      if (img == null) return null;
      fPIDs.put(ref + p.toString(), new MonolithPID(p.colourize(img.image()), img.offset()));
    }
    return fPIDs.get(ref + p.toString());
  }
View Full Code Here

    };
    fProperties = new LogicProperty[]{area, team};
  }
 
  public static AnimatedSprite editorIcon(JSONObject object) throws JSONException {
    MonolithPID pid = GruntzGame.resourceManager().pid(object.getString("area") + "/IMAGEZ/FORT/FRAME001");
    return new AnimatedSprite(new Image[] {pid.image()}, new Vector2f[] {pid.offset()});
  }
View Full Code Here

    fPalette = new GruntPalette(fColor, GruntzGame.resourceManager().rez().file("GRUNTZ/PALETTEZ/" + fColor + "TOOL", "pal"));
    animate("IDLE1", "IDLE");
    fCursor = new MonolithANI(GruntzGame.resourceManager().rez().file("GAME/ANIZ/GRUNTSELECTEDSPRITE", "ani"), "GAME/IMAGEZ/GRUNTSELECTEDSPRITE").sprite();
   
    // Health
    fHealthSprite = new Sprite(new MonolithPID(GruntzGame.resourceManager().rez().file("GAME/IMAGEZ/GRUNTHEALTHSPRITE/FRAME001", "pid")).image());
    fHealthSprite.position(new Vector2f(-12, -26));
   
    fStaminaSprite = new Sprite(new MonolithPID(GruntzGame.resourceManager().rez().file("GAME/IMAGEZ/GRUNTSTAMINASPRITE/FRAME001", "pid")).image());
    fStaminaSprite.position(new Vector2f(-12, -32));
   
    // Setup the grunt movement
    fMovement = new GridAlignedMovementOld<Grunt>(this, new MovementMinion(), 0, 0) {

      /**
       * Serial key
       */
      private static final long serialVersionUID = -3074929548144342979L;

      @Override
      public boolean canMove(GridCoordinate target) {
        TreeSet<String> traits = fMap.traits(target);
        return (!traits.contains("solid") && !traits.contains("nogo") && !traits.contains("water") && gridManager().getFirstEntityOfTypeAt(target, Grunt.class, Grunt.this) == null);
      }
    };
    fMovement.setup(500, new LinearLerper());
   
    // Setup the tile watcher
    fTileWatcher = new Minion<GridEvent>() {
      public long run(com.pointcliki.event.Dispatcher<GridEvent> dispatcher, String type, GridEvent event) {
        checkTile();
        return Minion.CONTINUE;
      };
    };
   
    fHurter = new PeriodicRogue<Grunt>(this, null, 40, 0) {
     
      /**
       * Serial key
       */
      private static final long serialVersionUID = 6455636894570231644L;

      @Override
      public void run(Grunt entity, long currentFrame) {
        if (attributeAsBoolean("hurtable")) setStateHealth(fHealth.value() - 2);
      }
    };
    fStaminater = new PeriodicRogue<Grunt>(this, null, 4, 0) {
      /**
       * Serial key
       */
      private static final long serialVersionUID = 6455636894570231644L;

      @Override
      public void run(Grunt entity, long currentFrame) {
        fStamina.assign(fStamina.value() + 1);
        int val = Math.max(0, attributeAsInteger("stamina"));
       
        String s = (21 - val) + "";
        while (s.length() < 3) s = "0" + s;
        fStaminaSprite.image(new MonolithPID(GruntzGame.resourceManager().rez().file("GAME/IMAGEZ/GRUNTSTAMINASPRITE/FRAME" + s, "pid")).image());
       
        if ((fStamina).value() == 20) {
          removeChild(fStaminaSprite);
          cancel();
        }
View Full Code Here

TOP

Related Classes of com.pointcliki.dizgruntled.rez.MonolithPID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.