You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
700 B

  1. package rendering;
  2. import gameobjects.GameObject;
  3. import java.awt.Color;
  4. import java.awt.Graphics2D;
  5. public class CircleArtist extends Artist {
  6. protected double egoRad;
  7. protected Color color;
  8. public CircleArtist(GameObject go) {
  9. super(go);
  10. this.egoRad = 15.0;
  11. }
  12. public CircleArtist(GameObject go, double egoRad, Color color) {
  13. super(go);
  14. this.egoRad = egoRad;
  15. this.color = color;
  16. }
  17. @Override
  18. public void draw(Graphics2D g) {
  19. g.setColor(this.color);
  20. double x = this.getX();
  21. double y = this.getY();
  22. int posX = (int) (x - egoRad);
  23. int posY = (int) (y - egoRad);
  24. int rad = (int) (2 * egoRad);
  25. g.fillOval(posX, posY, rad, rad);
  26. }
  27. }