|
|
|
@ -251,23 +251,10 @@ class BalanceTtrsPlayer(TtrsPlayer, threading.Thread):
@@ -251,23 +251,10 @@ class BalanceTtrsPlayer(TtrsPlayer, threading.Thread):
|
|
|
|
|
while self.running: |
|
|
|
|
|
|
|
|
|
#print('player_id=%d xbal=%d ybal=%d' % (self.player_id, xbal, ybal)) |
|
|
|
|
if xbal == -128 or ybal == -128: |
|
|
|
|
self.evt = PlayerEvent.QUIT |
|
|
|
|
|
|
|
|
|
THRESHOLD = 40 |
|
|
|
|
if abs(xbal) < THRESHOLD and abs(ybal) < THRESHOLD: |
|
|
|
|
evt = None |
|
|
|
|
else: |
|
|
|
|
if abs(xbal) < abs(ybal): |
|
|
|
|
if ybal > 0: |
|
|
|
|
evt = PlayerEvent.ROTATE |
|
|
|
|
else: |
|
|
|
|
evt = PlayerEvent.DROP |
|
|
|
|
else: |
|
|
|
|
if xbal > 0: |
|
|
|
|
evt = PlayerEvent.MOVE_RIGHT |
|
|
|
|
else: |
|
|
|
|
evt = PlayerEvent.MOVE_LEFT |
|
|
|
|
|
|
|
|
|
MIN_TIMES = { |
|
|
|
|
PlayerEvent.MOVE_LEFT: 0.1, |
|
|
|
|