|
@ -29,5 +29,23 @@ public class SnakeView implements Drawable{ |
|
|
@Override |
|
|
@Override |
|
|
public void draw(Graphics g) { |
|
|
public void draw(Graphics g) { |
|
|
|
|
|
|
|
|
|
|
|
g.setColor(Color.GREEN); |
|
|
|
|
|
// g.fillRect((int)positions.get(0).getX(), |
|
|
|
|
|
// (int)positions.get(0).getY(), cellSize, cellSize); |
|
|
|
|
|
g.fillOval((int)positions.get(0).getX(), |
|
|
|
|
|
(int)positions.get(0).getY(), cellSize, cellSize); |
|
|
|
|
|
|
|
|
|
|
|
int r = 144; |
|
|
|
|
|
int g1 = 238; |
|
|
|
|
|
int b = 144; |
|
|
|
|
|
g.setColor(new Color(r, g1, b)); |
|
|
|
|
|
for(int i = 1; i < positions.size(); ++i) |
|
|
|
|
|
{ |
|
|
|
|
|
// g.fillRect((int)positions.get(i).getX(), |
|
|
|
|
|
// (int)positions.get(i).getY(), cellSize, cellSize); |
|
|
|
|
|
|
|
|
|
|
|
g.fillOval((int)positions.get(i).getX(), |
|
|
|
|
|
(int)positions.get(i).getY(), cellSize, cellSize); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |