Browse Source

removed old balance to event evaluation

feature/balanceutils
informaniac 7 years ago
parent
commit
ca848e9ba1
  1. 13
      games/ttrs.py

13
games/ttrs.py

@ -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,

Loading…
Cancel
Save