Hi,
I wanted to test how Javafx managed a large amount of nodes, and how fast it can run. So I did this adaptation of John Conway's Game Of Life. (https://en.wikipedia.org/wiki/Conway's_Game_of_Life)
With this code, I can handle a grid of 80x80 on my computer. I tried higher than that, but it's too slow. The first attempt I did was to refresh the whole grid every time, but it was way too slow. So I had to store the active square in an array, and search only around those active ones. You can see the debug information, showing the active area.
My conclusion, is either I haven't optimized the code enough, or Javafx just can't handle this project very well.
If anyone has a better idea on how to process the grid faster, please share
How to use it?
just click on the grid, it and hit "Play". You can try different shapes : http://www.bitstorm.org/gameoflife/lexicon/
Also:
It's a nice example on how to use a GridPane (wrapper code included).
I wanted to test how Javafx managed a large amount of nodes, and how fast it can run. So I did this adaptation of John Conway's Game Of Life. (https://en.wikipedia.org/wiki/Conway's_Game_of_Life)
With this code, I can handle a grid of 80x80 on my computer. I tried higher than that, but it's too slow. The first attempt I did was to refresh the whole grid every time, but it was way too slow. So I had to store the active square in an array, and search only around those active ones. You can see the debug information, showing the active area.
My conclusion, is either I haven't optimized the code enough, or Javafx just can't handle this project very well.
If anyone has a better idea on how to process the grid faster, please share
How to use it?
just click on the grid, it and hit "Play". You can try different shapes : http://www.bitstorm.org/gameoflife/lexicon/
Also:
It's a nice example on how to use a GridPane (wrapper code included).