Adding detection for game end
This commit is contained in:
parent
efe8f98177
commit
e2d5f2580b
@ -175,10 +175,12 @@ class Game:
|
|||||||
self.tetrad = Tetrad.random()
|
self.tetrad = Tetrad.random()
|
||||||
self.tetrad_next = Tetrad.random()
|
self.tetrad_next = Tetrad.random()
|
||||||
self.counter = 0
|
self.counter = 0
|
||||||
|
self.active = True
|
||||||
|
|
||||||
|
|
||||||
def end_game(self):
|
def end_game(self):
|
||||||
self.reset_board()
|
self.reset_board()
|
||||||
|
self.active = False
|
||||||
|
|
||||||
|
|
||||||
def reset_board(self):
|
def reset_board(self):
|
||||||
@ -195,9 +197,12 @@ class Game:
|
|||||||
|
|
||||||
|
|
||||||
def advance(self, elapsed):
|
def advance(self, elapsed):
|
||||||
|
if not self.active:
|
||||||
|
return
|
||||||
|
|
||||||
self.counter += elapsed
|
self.counter += elapsed
|
||||||
if self.counter > self.interval:
|
if self.counter > self.interval:
|
||||||
self.input_down()
|
self.lower_tetrad()
|
||||||
|
|
||||||
|
|
||||||
def try_placement(self, tetrad):
|
def try_placement(self, tetrad):
|
||||||
|
Loading…
Reference in New Issue
Block a user