-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCircle.java
36 lines (29 loc) · 911 Bytes
/
Circle.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* CIS 120 Game HW
* (c) University of Pennsylvania
* @version 2.1, Apr 2017
*/
//import java.awt.*;
/**
* A basic game object starting in the upper left corner of the game court. It is displayed as a
* circle of a specified color.
*/
/*
public class Circle extends GameObj {
public static final int SIZE = 20;
public static final int INIT_POS_X = 170;
public static final int INIT_POS_Y = 170;
public static final int INIT_VEL_X = 2;
public static final int INIT_VEL_Y = 3;
private Color color;
public Circle(int courtWidth, int courtHeight, Color color) {
super(INIT_VEL_X, INIT_VEL_Y, INIT_POS_X, INIT_POS_Y, SIZE, SIZE, courtWidth, courtHeight);
this.color = color;
}
@Override
public void draw(Graphics g) {
g.setColor(this.color);
g.fillOval(this.getPx(), this.getPy(), this.getWidth(), this.getHeight());
}
}
*/