コード例 #1
0
 /**
  * Draw character in minimap
  *
  * @param g Graphics
  * @param Dx X Displacement
  * @param Dy Y Displacement
  */
 public void MapDraw(Graphics g, int Dx, int Dy, double Scale, Color col) {
   // Color
   g.setColor(col.darker().darker().darker());
   g.drawOval((int) (X * Scale + Dx), (int) (Y * Scale + Dy), 7, 7);
   g.setColor(col);
   g.fillOval((int) (X * Scale + Dx), (int) (Y * Scale + Dy), 7, 7);
 }
コード例 #2
0
  /**
   * Draw character in game window
   *
   * @param g Graphics
   * @param Dx X Displacement
   * @param Dy Y Displacement
   * @param G Growth factor
   */
  public void Draw(Graphics g, int Dx, int Dy, double G) {
    // Draw blood
    if (ISDEAD) {
      g.drawImage(
          imgBLOOD,
          (int) (X + Dx - 25),
          (int) (Y + Dy - 15),
          (int) (W * GROWTHFACTOR + 35),
          (int) (H * GROWTHFACTOR + 35),
          null);
    }

    // Quest Givers
    if (CLASS != "Player") {
      for (int i = 0; i < QUEST_LIST.size(); i++) {
        if (QUEST_LIST.elementAt(i).STATUS == 0) {
          g.drawImage(imgQStart, (int) (X + Dx + 5), (int) (Y + Dy - 30), (int) W, 35, null);
        } else if (QUEST_LIST.elementAt(i).STATUS == 2) {
          g.drawImage(imgQEnd, (int) (X + Dx), (int) (Y + Dy - 30), (int) W + 5, 35, null);
        }
      }
    }

    // Draw character
    g.drawImage(
        imgCHARAC,
        (int) (X + Dx),
        (int) (Y + Dy),
        (int) (X + Dx + W * G),
        (int) (Y + Dy + H * G),
        (int) (W * FX),
        (int) (H * FY),
        (int) (W * FX + W),
        (int) (H * FY + H),
        null);

    GROWTHFACTOR = G;
  }