called when ending BGE (e.g. to properly close network connections)
(controller)
| 124 | pass |
| 125 | |
| 126 | def end(controller): |
| 127 | """ |
| 128 | called when ending BGE (e.g. to properly close network connections) |
| 129 | """ |
| 130 | if controller.sensors[0].positive: |
| 131 | |
| 132 | # close socket |
| 133 | logic.socket.close() |
| 134 | controller.owner['SocketConnected'] = False |
| 135 | controller.owner['End'] = True |
| 136 | print('close socket') |
| 137 | |
| 138 | # close cv2 window |
| 139 | cv2.destroyAllWindows() |
| 140 | |
| 141 | # end game engine |
| 142 | logic.endGame() |