|
|
@ -6,6 +6,8 @@ import enum |
|
|
|
import threading |
|
|
|
import threading |
|
|
|
import argparse |
|
|
|
import argparse |
|
|
|
import subprocess |
|
|
|
import subprocess |
|
|
|
|
|
|
|
import socket |
|
|
|
|
|
|
|
import struct |
|
|
|
import blup.frame |
|
|
|
import blup.frame |
|
|
|
import blup.output |
|
|
|
import blup.output |
|
|
|
|
|
|
|
|
|
|
@ -29,7 +31,7 @@ class Game(object): |
|
|
|
if self.pygame: |
|
|
|
if self.pygame: |
|
|
|
args += ['--pygame'] |
|
|
|
args += ['--pygame'] |
|
|
|
if self.output is not None: |
|
|
|
if self.output is not None: |
|
|
|
args += ['--output', self.output] |
|
|
|
args += ['--out', self.output] |
|
|
|
return args |
|
|
|
return args |
|
|
|
|
|
|
|
|
|
|
|
class PongGame(Game): |
|
|
|
class PongGame(Game): |
|
|
@ -257,7 +259,9 @@ class BalanceInput(AbstractInput, threading.Thread): |
|
|
|
print('player_id=%d debounce %s' % (self.player_id, evt)) |
|
|
|
print('player_id=%d debounce %s' % (self.player_id, evt)) |
|
|
|
continue |
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
self.evt = evt |
|
|
|
if self.lastevent != evt: |
|
|
|
|
|
|
|
self.evt = evt |
|
|
|
|
|
|
|
self.lastevent = evt |
|
|
|
print('player_id=%d event=%s' % (self.player_id, self.evt)) |
|
|
|
print('player_id=%d event=%s' % (self.player_id, self.evt)) |
|
|
|
|
|
|
|
|
|
|
|
else: |
|
|
|
else: |
|
|
|