def start(self): print("resetting game") self.image = FlipdotImage.newWhiteFlipdotImage( self.width, self.height) self.reset_white() for x in range(self.width): for y in range(TOP): self.set_pixel(x, y) self.set_pixel(x, self.height-1) for y in range(self.height): self.set_pixel(0, y) self.set_pixel(self.width - 1, y) for player in self.players.values(): player.reset() player.draw() self.image.blitTextAtPosition("join this game by dividuum", xPos=5, yPos=2) self.image.blitTextAtPosition("http://%s:%d/" % (MYIP, PORT), xPos=5, yPos=9) self.flush()
def start(self): print "resetting game" self.image = FlipdotImage.newWhiteFlipdotImage( self.width, self.height) self.reset_white() for x in xrange(self.width): for y in xrange(TOP): self.set_pixel(x, y) self.set_pixel(x, self.height-1) for y in xrange(self.height): self.set_pixel(0, y) self.set_pixel(self.width - 1, y) for player in self.players.itervalues(): player.reset() player.draw() self.image.blitTextAtPosition("join this game by dividuum", xPos=5, yPos=2) self.image.blitTextAtPosition("http://%s:%d/" % (MYIP, PORT), xPos=5, yPos=9) self.flush()
def reset_white(self): black = FlipdotImage.newBlackFlipdotImage(self.width, self.height) self.matrix.show(black) white = FlipdotImage.newWhiteFlipdotImage(self.width, self.height) self.matrix.show(white)
def white(): whiteImage = FlipdotImage.newWhiteFlipdotImage(wandwidth, wandheight) matrix.show(whiteImage) return minipage("whited all!")