|
@ -1,10 +1,20 @@ |
|
|
package Snake; |
|
|
package Snake; |
|
|
|
|
|
|
|
|
import java.awt.Graphics; |
|
|
import java.awt.Graphics; |
|
|
|
|
|
import java.awt.Point; |
|
|
|
|
|
|
|
|
public class AppleView implements Drawable{ |
|
|
public class AppleView implements Drawable{ |
|
|
|
|
|
|
|
|
|
|
|
private final Point position; |
|
|
|
|
|
private final int size; |
|
|
|
|
|
|
|
|
|
|
|
public AppleView(int size) |
|
|
|
|
|
{ |
|
|
|
|
|
int x = 0; |
|
|
|
|
|
int y = 0; |
|
|
|
|
|
position = new Point(x, y); |
|
|
|
|
|
this.size = size; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void draw(Graphics g) { |
|
|
public void draw(Graphics g) { |
|
|