Hello!
I'm new to
Java, and this is my first "real" project that I'm actually satisfied with, so I thought I'd share it with you. Took a few days to write.
It's a version of the famous Game Of Life by John Conway, where the cells are represented by checkboxes (only because making some other graphic version would be too advanced for me).
It looks alright, you can choose three different sizes and four different speeds. The layout might not be correct for all systems (it's optimized for OSX), but just a simple resize of the window so the checkboxes form a square
pattern will do the trick.
Some questions:
-The checkCell()-method seems extremely clunky and awkward, and I guess there must be a better way to do it, any tips? Algorithms?
-The reason I put an infinite loop in the startGame()-method is because I kept getting exceptions when trying to stop and start the game, something about how threads work. Is there a better way to do this (without making a complete rewrite of the entire program)?
-Is there any way to make the gui platform independent?
Have fun! Code below:
GameOfLifeCell-class:
GameOfLife-class: