Browse Source

update

main
Justin Senn 2 years ago
parent
commit
7a0cc579b6
  1. 10
      src/main/java/Snake/SnakeView.java
  2. BIN
      target/classes/Snake/SnakeView.class

10
src/main/java/Snake/SnakeView.java

@ -15,6 +15,16 @@ public class SnakeView implements Drawable{
this.cellSize = cellSize; this.cellSize = cellSize;
} }
public void setPositions(ArrayList<Point> newPositions)
{
positions.clear();
for(var newPosition : newPositions)
{
Point positionInGrid = newPosition;
positions.add(new Point((int)positionInGrid.getX()*cellSize,
(int)positionInGrid.getY()*cellSize));
}
}
@Override @Override
public void draw(Graphics g) { public void draw(Graphics g) {

BIN
target/classes/Snake/SnakeView.class

Loading…
Cancel
Save