From 075e8c5c03443432c6c1b035676e523373d13bda Mon Sep 17 00:00:00 2001 From: informaniac Date: Fri, 1 Dec 2017 17:40:24 +0100 Subject: [PATCH] player information is now retrieved from the balance_util --- games/balancep0ng.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/games/balancep0ng.py b/games/balancep0ng.py index fbcf3a1..39673f1 100755 --- a/games/balancep0ng.py +++ b/games/balancep0ng.py @@ -94,8 +94,8 @@ class BalanceBoardPlayer(object): bal = self.__balance_util.get_raw_2dir_y() if bal == -128: - print("player %d has quit" % (self.__player_id)) - self.__wiimote_sock.close() + print("player %d has quit" % self.__balance_util.player_id) + self.__balance_util.socket.close() sys.exit(1) bal = -bal @@ -107,7 +107,7 @@ class BalanceBoardPlayer(object): bal += MAX_AMPLITUDE pos = int((bal / (2 * MAX_AMPLITUDE)) * self.__playground.height) - print("player %d pos=%d" % (self.__player_id, pos)) + print("player %d pos=%d" % self.__balance_util.player_id, pos) if self.__ownPaddle.ypos > pos: self.__ownPaddle.nextMoveUp()