09 March

Game Of Life JAVA Application

Written by 

 

Project Description

The Conway's Game of Life ... Done for a school project in 2014, it was a very challenging and ambitious project but also very interesting.

After spending some hours analysing Conway's theory, the challenged was proposed to the class to built a Java application that could simulate the Game of Life.
With this came several requirements such as:

  • Ability to enable/disable cells via mouse click.
  • Ability to read a matrix from a file and load it.
  • Ability to write current matrix to file.
  • Zoom and Speed
  • Spherical Matrix

So naturally there was some pressure to make it all work within the schedule provided.

The "Matrix"

From the beginning, problems soon arrived, main issue was "how to draw a grill that could visually interpret-ate the matrix cells ? ", initially I thought of creating a buffered image that could be manipulated as the simulation occurred, problem with this was the processing time, since it was generating an image on every iteration of the simulation, proving it to be slow and cpu consuming.

In the end, a JPanel was used and lines were drawn within it to make look like a matrix, from there customization was done, spending some hours in the GUI making it looking as good as i could.

The "Engine"

The engine part was very tricky because its when you pass from the theory to the action.
Naturally that happened with a multidimensional array that could accommodate the matrix size, and a cycle was programmed so that it analysed every cell on each iteration pass, this way the system could apply Conway's rules depending on the cell state.

Unfortunately not all went accordingly to plan on this one, as the application bypasses a couple of rules I wrote and does not renders exactly as Conway's describes.
However the GUI part of it works very well and the logic can easily be fixed in a future enhancement.

Final Notes

Very exciting project that took a lot of hours in front of the screen but I was very happy with the end result.

Project Information

Categories: Application Development

Video Url: https://www.youtube.com/watch?v=Ab9fL1kk2Mo&rel=0

Project Timeline

Start: Jan, 2013

End: Feb, 2013

Media

 

Read 1008 times Last modified on Tuesday, 18 October 2016 15:15
Rate this item
(0 votes)

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

Latest Posts

Contacts

João Vieira

Skype: jcv.pt

Email: info@joao-vieira.pt

About

This is my personal page, here you will find IT related, projects, discussions and reviews. Feel free to coment and leave your input.