Skip to content

Commit c12ee52

Browse files
committed
remove extra print, add game over case
1 parent c6c9ef2 commit c12ee52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Micro2048/Micro2048.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ class GameState:
152152
def __init__(self):
153153
global continuable
154154
if saveData.hasItem('boardState') == False:
155-
156155
continuable = False
157156
else:
158157
continuable = True
@@ -180,6 +179,8 @@ def prepare(self):
180179
for j in self.field.field_range():
181180
if jdata[i][j] >= 0:
182181
self.field.restore_panel(j, i, jdata[i][j])
182+
if self.field.is_playable() == False:
183+
self.gameover = True;
183184

184185

185186
self.idle = 0
@@ -249,7 +250,6 @@ def saveGameState(self):
249250
if self.field.panels[i][j]:
250251
mapData[i][j] = self.field.panels[i][j].value
251252
json_data = json.dumps(mapData)
252-
print(json_data)
253253
saveData.setItem('boardState', json_data)
254254
saveData.save()
255255

0 commit comments

Comments
 (0)