from TCPIPWrapper import TCPServer s = TCPServer(2222) while True: input = raw_input("Enter 1 for Yes, 0 for No: ") s.send(input)
################ ## Game Loops ## ################ if __name__ != "__main__": print "Unknown run configuration" exit() parser = argparse.ArgumentParser() parser.add_argument('--bci', nargs='+', help="IP and port of the BCI machine. Just specify port to make a server connection", required=True) parser.add_argument('--tms', nargs='+', help="IP and port of the TMS machine. Just specify port to make a server connection", required=True) args = parser.parse_args() #network sockets bciSocket = TCPServer(int(args.bci[0])) if len(args.bci) == 1 else TCPClient(args.bci[0], int(args.bci[1])) tmsSocket = TCPServer(int(args.tms[0])) if len(args.tms) == 1 else TCPClient(args.tms[0], int(args.tms[1])) x = GameScreen(pyScreen,backImage,pygame.color.Color(121,74,0,0)) #x.addTextElem("fps","FPS: ",1069,33,pygame.color.Color(255,229,187,255),pygame.color.Color(121,74,0,0),17) x.addTextElem("score","Score: ",1164,55,pygame.color.Color(255,229,187,255),pygame.color.Color(121,74,0,0),36) x.addTextElem("attempts","Attempts: ",1164,110,pygame.color.Color(255,229,187,255),pygame.color.Color(121,74,0,0),36) x.addTextElem("bigAnyKey","Press space to play",646,407,pygame.color.Color(255,235,175,255),pygame.color.Color(121,74,0,0),72) x.addTextElem("bigScore","Score: ",646,387,pygame.color.Color(255,235,175,255),pygame.color.Color(121,74,0,0),72) x.addTextElem("bigAttempts","Attempts: ",646,487,pygame.color.Color(255,235,175,255),pygame.color.Color(121,74,0,0),72) x.addTextElem("countdown","0",646,407,pygame.color.Color(255,235,175,255),pygame.color.Color(121,74,0,0),100) clock=pygame.time.Clock() goodScore = 0 badScore = 0