MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / __init__

Method __init__

DemoPrograms/Demo_Pong_Multiple_Platforms.py:33–46  ·  view source on GitHub ↗
(self, graph, bat_1, bat_2, colour)

Source from the content-addressed store, hash-verified

31
32class Ball:
33 def __init__(self, graph, bat_1, bat_2, colour):
34 self.graph = graph # type: sg.Graph
35 self.bat_1 = bat_1
36 self.bat_2 = bat_2
37 self.player_1_Score = player_1_Starting_Score
38 self.player_2_Score = player_2_Starting_Score
39 self.draw_P1 = None
40 self.draw_P2 = None
41 self.id = self.graph.draw_circle(
42 STARTING_BALL_POSITION, BALL_RADIUS, line_color=colour, fill_color=colour)
43 self.curx, self.cury = STARTING_BALL_POSITION
44 # self.graph.relocate_figure(self.id, STARTING_BALL_POSITION[0], STARTING_BALL_POSITION[1])
45 self.x = random.choice([-2.5, 2.5])
46 self.y = -2.5
47
48 def win_loss_check(self):
49 winner = None

Callers

nothing calls this directly

Calls 1

draw_circleMethod · 0.80

Tested by

no test coverage detected