MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/578808_Python_Game_of_Life/recipe-578808.py:103–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101
102class Game():
103 def __init__(self):
104 #window setup
105 pygame.display.set_caption('Game Of Life')
106
107 # initiate the clock and screen
108 self.clock = pygame.time.Clock()
109 self.last_tick = pygame.time.get_ticks()
110 self.screen_res = [740, 490]
111
112 self.font = pygame.font.SysFont("Impact", 19)
113
114 self.sprites = pygame.sprite.Group()
115 self.cells = []
116 self.generation = 0
117 self.population = 0
118
119 self.screen = pygame.display.set_mode(self.screen_res, pygame.HWSURFACE, 32)
120
121 self.running = False
122 self.createGrid()
123
124 while 1:
125 self.Loop()
126
127 def createGrid(self):
128 col = 0

Callers

nothing calls this directly

Calls 2

createGridMethod · 0.95
LoopMethod · 0.95

Tested by

no test coverage detected