Jul-20-2020, 07:49 AM
Hi,
I have programmed a game involving a tkinter canvas of 900x900,
divided into 60x60 cells of different colors.
To show each new situation, it takes some time (seconds),
and tests proved that updating the canvas takes more than half of that time.
So the question is, can i find a faster update mechanism than the one i implemented:
cell_size is obviously 15 pixels.(i also think cell size has no influence or very little)
I have programmed a game involving a tkinter canvas of 900x900,
divided into 60x60 cells of different colors.
To show each new situation, it takes some time (seconds),
and tests proved that updating the canvas takes more than half of that time.
So the question is, can i find a faster update mechanism than the one i implemented:
cell_size is obviously 15 pixels.(i also think cell size has no influence or very little)
def new_gen(): for row in range(60): for col in range(60): y = row * cell_size x = col * cell_size Kanvas.create_rectangle(x,y,x+cell_size,y+cell_size,fill='somecolor') root.update()Paul