Example #1
0
  public void render(Graphics graphics) throws SlickException {
    // ballImage.draw(ballPosX - BALL_RADIUS, ballPosY - BALL_RADIUS);
    graphics.setColor(Color.white);
    graphics.drawOval(ballPosX, ballPosY, BALL_RADIUS, BALL_RADIUS);
    // graphics.setColor(Color.gray);

    graphics.setColor(Color.white);
    graphics.drawOval(oldBallPosX, oldBallPosY, BALL_RADIUS - 2, BALL_RADIUS - 2);
    // graphics.setColor(Color.gray);

    // graphics.setLineWidth(BAll_BORDER);
    // graphics.fillOval(ballPosX + BAll_BORDER, ballPosY + BAll_BORDER , BALL_RADIUS - BAll_BORDER,
    // BALL_RADIUS - BAll_BORDER);
  }
Example #2
0
  public void pinta(Graphics g) {
    float ancho_anterior = g.getLineWidth();
    Color color_anterior = g.getColor();
    // /////////////////////////////////
    g.setLineWidth(3);
    this.actualizaAngulo();
    g.setColor(new Color(1, 0, 0, 0.2f));
    g.fillArc(
        this.centroX - radio, this.centroY - radio, radio * 2, radio * 2, 270, this.angulo - 90);

    g.setAntiAlias(true);

    g.setColor(this.color_reloj);
    g.drawOval(this.centroX - radio, this.centroY - radio, radio * 2, radio * 2);
    float px = 0, py = 0;

    px = (float) (this.centroX + radio * 8 / 10 * Math.cos(Math.toRadians(angulo) - Math.PI / 2));
    py = (float) (this.centroY + radio * 8 / 10 * Math.sin(Math.toRadians(angulo) - Math.PI / 2));
    g.setColor(color_manilla);
    g.drawLine(centroX, centroY, px, py);
    g.setAntiAlias(false);

    // /////////////////////////////////
    g.setLineWidth(ancho_anterior);
    g.setColor(color_anterior);
  }
Example #3
0
  public void render(GameContainer gc, Graphics gfx) throws SlickException {
    Point pt = playMap.getPos();
    if (path != null) {
      for (int i = 0; i < path.getLength(); i++) {
        Path.Step step = path.getStep(i);
        gfx.setColor(Color.white);
        gfx.drawRect(
            pt.getX() + step.getX() * playMap.getTileWidth(),
            pt.getY() + step.getY() * playMap.getTileHeight(),
            playMap.getTileWidth(),
            playMap.getTileHeight());
      }
    }

    if (pathStep != null) {
      Point foe = new Point(pt);
      gfx.drawOval(
          foe.getX() + pathStep.getX() * playMap.getTileWidth() + 4,
          foe.getY() + pathStep.getY() * playMap.getTileHeight() + 4,
          9,
          9);
    }
  }
Example #4
0
 public void draw(Graphics g, int[] extraSize) {
   g.drawOval((x * 10) + extraSize[1], (y * 10) + extraSize[0], 10, 10);
 }