A new version of this scenario was uploaded on Fri Jul 20 01:30:47 UTC 2012
A new version of this scenario was uploaded on Fri Jul 20 01:32:31 UTC 2012
It now corrisponds with Conway"s rules or life I just need to find a way to get the cells into the game.
A new version of this scenario was uploaded on Mon Jul 30 00:28:02 UTC 2012
Game actually plays now, click to place cells, hold space to run.
You may want to add a failsafe (if !Greenfoot.isKeyDown("space") { running = false; }) because there is a glitch where if often thinks the spacebar is down when it's not.
I'm not sure the rules are being modeled correctly, as several famous configurations like the glider of the F-pentomino do not give the proper results.
I think the problem is due to the code to change each cell is in the act method which will not work properly there. The way it needs to work is that all cells need to be calculated to determine the next state for all the cells before changing any of them. And then, changing all of them at once. In other words, the press of the spacebar should be in the sub-class of world, and each time it is found to be pressed iterate through all the cells to figure out there next states, and then iterate though all the cells, changing to the states figured.
@ Builderboy2005 The rules aren't working properly right now because the world starts full of "empty cells" and placing populated cells on top of them doesn't remove the empty cell class(right now, I'm still trying to figure that). Which means all the cells think they have one more empty cell around them then they actually do.
I just got super busy with school so I probably won't be working on this for a long time, if you like the game there are other completed ones on greenfoot as well many other places online.
2012/7/19
2012/7/19
2012/7/30
2012/8/13
2012/8/14
2012/8/14
2012/8/14
2012/8/19
2012/9/8