Skip to content

Commit

Permalink
initial commit of GridStuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JCS12011 committed Dec 2, 2016
1 parent 179c8cb commit 0f20962
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/main/GridStuff.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package main;


import main.Controller;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;


public class GridStuff{

int red = 1;
int yellow = -1;
int white = 0;

private double canvasWidth = 769;
private double canvasHeight = 769;

private double n = 10;
private double m = 10;

double getWidth = canvasWidth / 10;
double getHeight = canvasHeight /10;

GridStuff [][] map = new GridStuff[(int) n][(int) m];

//void draw();
//void setZoom(double z);

public GridStuff(Canvas canvas, double zoom){
GraphicsContext gc = canvas.getGraphicsContext2D();

for( int i=0; i < n; i++) {
for( int j=0; j < m; j++) {
//if(condition 1){
gc.setFill(Color.BLACK);
gc.fillRect(i*getWidth, j*getHeight, getWidth, getHeight);
gc.setFill(Color.INDIANRED);
gc.fillRect(i*getWidth, j*getHeight, getWidth - 2, getHeight - 2);
//}
/*if(condition 2){
gc.setFill(Color.BLACK);
gc.fillRect(i*getWidth, j*getHeight, getWidth, getHeight);
gc.setFill(Color.WHITE);
gc.fillRect(i*getWidth, j*getHeight, getWidth - 2, getHeight - 2);
}
if(condition 3){
gc.setFill(Color.BLACK);
gc.fillRect(i*getWidth, j*getHeight, getWidth, getHeight);
gc.setFill(Color.LIGHTGOLDENRODYELLOW);
gc.fillRect(i*getWidth, j*getHeight, getWidth - 2, getHeight - 2);
}*/
}
}
}
}

0 comments on commit 0f20962

Please sign in to comment.