drawing
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ public class Clock extends Thread{
|
||||
}
|
||||
};
|
||||
|
||||
t.scheduleAtFixedRate(tt, 1000, 20000);
|
||||
t.scheduleAtFixedRate(tt, 1000, 200);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -216,16 +216,18 @@ public class Control {
|
||||
}
|
||||
|
||||
|
||||
public void addCell(int x, int y) {
|
||||
System.out.print("X" + x + "|" + "Y" + y + " ");
|
||||
public void addCell(int mouseX, int mouseY) {
|
||||
System.out.print("X" + mouseX + "|" + "Y" + mouseY + " ");
|
||||
|
||||
System.out.println((int) (x / (800f / xSize)));
|
||||
|
||||
// cells[(int) ((x / (800f / xSize)) + ((800f / xSize)/2))][(int) ((y / (800f / ySize)) + ((800f / ySize)/2))] = true;
|
||||
System.out.println(mouseX / (800 / xSize) + " ");
|
||||
|
||||
cells[(mouseX - 30) / (800 / xSize)][(mouseY - 30) / (800 / ySize)] = true;
|
||||
showGrid(cells);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void removeCell(int x, int y) {
|
||||
|
||||
cells[Math.round(y/(800f/xSize))][Math.round(y/(800f/ySize))] = false;
|
||||
|
||||
+2
-1
@@ -394,7 +394,8 @@ public class GUI {
|
||||
|
||||
jfGameManuel = new JFrame(title);
|
||||
|
||||
jfGameManuel.getContentPane().setPreferredSize(new Dimension(1000, 1000));
|
||||
jfGameManuel.getContentPane().setPreferredSize(new Dimension(800, 800));
|
||||
|
||||
jfGameManuel.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
jfGameManuel.setResizable(false);
|
||||
|
||||
Reference in New Issue
Block a user