MCPcopy Create free account
hub / github.com/geekcomputers/Python / PongPongWindow

Class PongPongWindow

PongPong_Game/pongpong.py:20–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class PongPongWindow(pyglet.window.Window):
21 def __init__(self, *args, **kwargs):
22 super(PongPongWindow, self).__init__(*args, **kwargs)
23
24 self.win_size = (WIDTH, HEIGHT)
25 self.paddle_pos = (WIDTH / 2 - PWIDTH / 2, 0)
26 self.main_batch = pyglet.graphics.Batch()
27 self.walls = load.load_rectangles(self.win_size, BORDER, batch=self.main_batch)
28 self.balls = load.load_balls(
29 self.win_size, RADIUS, speed=ballspeed, batch=self.main_batch
30 )
31 self.paddles = load.load_paddles(
32 self.paddle_pos, PWIDTH, PHEIGHT, acc=paddleacc, batch=self.main_batch
33 )
34
35 def on_draw(self):
36 self.clear()
37 self.main_batch.draw()
38
39
40game_window = PongPongWindow(width=WIDTH, height=HEIGHT, caption="PongPong")

Callers 1

pongpong.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected