From cfa15f9658cd602a17227c79a67ddb6d9dba2702 Mon Sep 17 00:00:00 2001 From: Justin Senn Date: Mon, 6 Feb 2023 16:35:01 +0100 Subject: [PATCH] update --- src/main/java/Snake/SnakeView.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/Snake/SnakeView.java b/src/main/java/Snake/SnakeView.java index 89c10aa..419d924 100644 --- a/src/main/java/Snake/SnakeView.java +++ b/src/main/java/Snake/SnakeView.java @@ -29,5 +29,23 @@ public class SnakeView implements Drawable{ @Override 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); + } } }