Conway's Game of Life/Java/Swing: Difference between revisions
Content added Content deleted
(Added the Java swing based implementation to cut down on clutter on the main page. (as discussed on the main talk page)) |
m (Hardcoded value changed to its variable counterpart.) |
||
Line 200: | Line 200: | ||
public void addPoint(MouseEvent me) { |
public void addPoint(MouseEvent me) { |
||
int x = me.getPoint().x/ |
int x = me.getPoint().x/BLOCK_SIZE-1; |
||
int y = me.getPoint().y/ |
int y = me.getPoint().y/BLOCK_SIZE-1; |
||
if ((x >= 0) && (x < d_gameBoardSize.width) && (y >= 0) && (y < d_gameBoardSize.height)) { |
if ((x >= 0) && (x < d_gameBoardSize.width) && (y >= 0) && (y < d_gameBoardSize.height)) { |
||
addPoint(x,y); |
addPoint(x,y); |