Browse Source

removed socket retrieval function

feature/balanceutils
informaniac 7 years ago
parent
commit
9c2d3cb33a
  1. 12
      games/balancep0ng.py

12
games/balancep0ng.py

@ -73,18 +73,6 @@ def convertPixels(dimension, pixels, invert=False): @@ -73,18 +73,6 @@ def convertPixels(dimension, pixels, invert=False):
p.append(row)
return p
def get_balance_from_sock(sock, player_id):
print('will balance haben...')
sock.send(b'a')
data = sock.recv(4)
p1x, p1y, p2x, p2y = struct.unpack('bbbb', data)
if player_id == 0:
bal = p1y
elif player_id == 1:
bal = p2y
print('balance id=%s balance=%d' % (player_id, bal))
return bal
class BalanceBoardPlayer(object):
def __init__(self, playground, ownPaddle, wiimote_sock, player_id):
self.__playground = playground

Loading…
Cancel
Save