Closed sekkurocode closed 5 months ago
I merged now and will work on the integration :-)
First I went into the game of life.py and deleted the unused classes Player and Board. I migrated the game class to kivy.app by setting the rows and cols to grid size parameter (50) [Maybe we can create a slider or input to customize the size and make it adjustable]. Inside the class there is the function update_board wich sets the board to anew state by counting neighbors and depending on the ruleset, setting a new value for the next generation first on a temporary, then on the final board. The class Game instancinates within the GUI [Lets move it out of there?] in the init method. The update_board method of it is called within a new function inside the gui class, called "def update". While running it first updates the board and than calls the new function "update_grid", wich sets the colors of all cells depending on their new status (alive or dead) by calling the "update_color" function of the Cell class. They get their status by looking at itselfs updated board state [Might lead to slow runtimes further down the line?] New issues that will be created:
See how to connect our Cellular Automata with our Kivy GUI Window.