Esempio n. 1
0
 @Override
 public void draw(Vec2 pos) {
   super.draw(pos);
   Graphics2D.fillRect(pos.add(new Vec2(-20, -20)), new Vec2(40, 6), BLACK);
   Graphics2D.fillRect(pos.add(new Vec2(-20, -20)), new Vec2(40. * health / maxHealth, 6), GREEN);
   Graphics2D.drawRect(pos.add(new Vec2(-20, -20)), new Vec2(40, 6), BLACK);
 }
Esempio n. 2
0
  public boolean containsClick(Vec2 click) {

    return click.containedBy(pos.add(dim), pos);
  }