Browse Source

Merge branch 'master' of blinkenbunt:gitrepos/blup3

master
klonfish 8 years ago committed by klonfish
parent
commit
59e4e79050
  1. 2
      pong.py
  2. 7
      ttrs.py

2
pong.py

@ -262,7 +262,7 @@ class Playground(object):
break break
for callback in self.__gameTickCallbacks: for callback in self.__gameTickCallbacks:
print(callback) #print(callback)
callback() callback()
if ball.xpos >= self.width: if ball.xpos >= self.width:

7
ttrs.py

@ -263,7 +263,7 @@ class BalanceTtrsPlayer(TtrsPlayer, threading.Thread):
elif self.player_id == 1: elif self.player_id == 1:
xbal, ybal = p1x, p1y xbal, ybal = p1x, p1y
print('player_id=%d xbal=%d ybal=%d' % (self.player_id, xbal, ybal)) #print('player_id=%d xbal=%d ybal=%d' % (self.player_id, xbal, ybal))
if xbal == -128 or ybal == -128: if xbal == -128 or ybal == -128:
self.evt = PlayerEvent.QUIT self.evt = PlayerEvent.QUIT
@ -293,7 +293,7 @@ class BalanceTtrsPlayer(TtrsPlayer, threading.Thread):
oldevt = evt oldevt = evt
if time.time() - lastchange < MIN_TIMES.get(evt, 0): if time.time() - lastchange < MIN_TIMES.get(evt, 0):
print('player_id=%d debounce %s' % (self.player_id, evt)) #print('player_id=%d debounce %s' % (self.player_id, evt))
continue continue
if evt == PlayerEvent.ROTATE: if evt == PlayerEvent.ROTATE:
@ -302,11 +302,12 @@ class BalanceTtrsPlayer(TtrsPlayer, threading.Thread):
else: else:
self.evt = evt self.evt = evt
self.lastevt = evt self.lastevt = evt
print('player_id=%d event=%s' % (self.player_id, self.evt)) #print('player_id=%d event=%s' % (self.player_id, self.evt))
def get_event(self): def get_event(self):
print('player_id=%d event=%s' % (self.player_id, self.evt))
evt = self.evt evt = self.evt
self.evt = None self.evt = None
return evt return evt

Loading…
Cancel
Save