Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. def checkstate():
  2. print('check')
  3.  
  4. if len(player1.ship_sizes) != 0:
  5. x = time.time()
  6. if len(ai.ship_sizes) != 0:
  7. ai_place = ai.ai_place()
  8. refresh_ocean('place')
  9. y = time.time()
  10. print(y-x)
  11. else:
  12. x = time.time()
  13. if (sorted(player1.hits) != sorted(ai.ai_placedships)) and len(player1.placedships) != 0:
  14. attack = attackGui()
  15. instructionLabel.destroy()
  16. refresh_ocean('attackselection')
  17.  
  18. else:
  19. popup = Tk()
  20. p_label = Label(popup,text='GAME OVER')
  21. popup.after(5000,p_label.destroy())
  22. tk.destroy()
  23. y=time.time()
  24. print(y-x)
  25. tk.after(1000, checkstate)
  26. checkstate()
  27. tk.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement