Example #1
0
  /**
   * Prepare one animation step.
   *
   * @param d draw surface
   * @param dt time passed since last move
   */
  public void doOneFrame(DrawSurface d, double dt) {
    Color backgColor = new Color(205, 252, 228);
    Color textColor = new Color(51, 175, 150);

    // Draw background
    new Rectangle(0, 0, d.getWidth(), d.getHeight(), backgColor).drawOn(d);

    // Draw text
    d.setColor(textColor);
    String stopKey = Finals.getInstance().getStopAnimationKey();
    d.drawText(180, 80, "Paused. Press " + stopKey + " to continue", 30);
  }
Example #2
0
 /** @param surface to draw the ball on draw the ball on the given DrawSurface */
 public void drawOn(DrawSurface surface) {
   surface.setColor(this.color);
   surface.fillCircle((int) this.center.getX(), (int) this.center.getY(), this.r);
 }