def __init__(self, racket, graphWin): Rectangle.__init__(self, Point(385, 285), Point(415, 315)) if graphWin.render: self.setFill(racket.color) self.draw(graphWin) self.speedX = 0 self.speedY = 5
def __init__(self, point, color): top_left_corner = Point(point.x * Block.PIXEL_TO_SQUARE_CONVERTING, point.y * Block.PIXEL_TO_SQUARE_CONVERTING) bottom_right_corner = Point(top_left_corner.x + Block.WIDTH_OF_SQUARE, top_left_corner.y + Block.WIDTH_OF_SQUARE) Rectangle.__init__(self, top_left_corner, bottom_right_corner) self.setFill(color)
def __init__(self, pos, color): self.x = pos.x self.y = pos.y p1 = Point(pos.x*Block.BLOCK_SIZE + Block.OUTLINE_WIDTH, pos.y*Block.BLOCK_SIZE + Block.OUTLINE_WIDTH) p2 = Point(p1.x + Block.BLOCK_SIZE, p1.y + Block.BLOCK_SIZE) Rectangle.__init__(self, p1, p2) self.setWidth(Block.OUTLINE_WIDTH) self.setFill(color)
def __init__(self, point, color): top_left_corner = Point(point.x * Block.BLOCK_SIZE, point.y * Block.BLOCK_SIZE) bottom_right_corner = Point(top_left_corner.x + Block.BLOCK_SIZE, top_left_corner.y + Block.BLOCK_SIZE) Rectangle.__init__(self, top_left_corner, bottom_right_corner) self.setFill(color)
def __init__(self, graphWin, id): Rectangle.__init__(self, Point(350, 570), Point(450, 590)) self.id = id self.color = color_rgb(random.randint(10, 255), random.randint(10, 255), random.randint(10, 255)) self.score = 0 if graphWin.render: self.setFill(self.color) self.draw(graphWin) self.ball = Ball(self, graphWin) self.alive = True
def __init__(self, graphWin, player_id, popName=False, playerSize=50): playerStartingPoint = [30, 540] self.player_id = player_id Rectangle.__init__( self, Point(playerStartingPoint[0], playerStartingPoint[1]), Point(playerStartingPoint[0] + playerSize, playerStartingPoint[1] + playerSize)) self.graphWin = graphWin self.speed = 0 self.status = 'nothing' self.alive = True self.setFill( color_rgb(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))) self.setOutline(color_rgb(0, 0, 0)) if self.graphWin.renderization: self.draw(graphWin) if self.graphWin.gameMode == 'aitrain': self.brain = Network(popName + str(player_id))
def __init__(self, pX, pY): Rectangle.__init__(self, Point(pX, pY), Point(pX + 1, pY + 1)) self.setFill(color_rgb(255, 255, 255))
def __init__(self, graphWin, p1=Point(100, 280), p2=Point(120, 300)): Rectangle.__init__(self, p1, p2) if graphWin.render: self.setFill(color_rgb(255, 0, 0)) self.draw(graphWin)
def __init__(self, point1, point2, win): self.point1 = point1 self.point2 = point2 self.win = win Rectangle.__init__(self, (self.point1), (self.point2)) self.draw(win)