Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def checkstate():
- print('check')
- if len(player1.ship_sizes) != 0:
- x = time.time()
- if len(ai.ship_sizes) != 0:
- ai_place = ai.ai_place()
- refresh_ocean('place')
- y = time.time()
- print(y-x)
- else:
- x = time.time()
- if (sorted(player1.hits) != sorted(ai.ai_placedships)) and len(player1.placedships) != 0:
- attack = attackGui()
- instructionLabel.destroy()
- refresh_ocean('attackselection')
- else:
- popup = Tk()
- p_label = Label(popup,text='GAME OVER')
- popup.after(5000,p_label.destroy())
- tk.destroy()
- y=time.time()
- print(y-x)
- tk.after(1000, checkstate)
- checkstate()
- tk.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement