-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpuck.only.py
52 lines (34 loc) · 1.13 KB
/
puck.only.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import pygame
pygame.init()
screen = pygame.display.set_mode([1000, 810])
scree = pygame.display.set_caption ( "Paddles and puck")
running = True
x = 500
y = 500
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT:
x -=10
if event.key == pygame.K_RIGHT:
x +=10
if event.key == pygame.K_UP:
y -=10
if event.key == pygame.K_DOWN:
y +=10
#screen.fill((0, 0,))
#does't show rectangle just black background
# Initializing Color
#color = (0, 0, 153)
# Drawing Rectangle
#pygame.draw.rect(screen, color, pygame.Rect(0, 230, 30, 500))
pygame.display.flip()
# Initializing Color
#color = (153, 0, 0)
# Drawing Rectangle
#pygame.draw.rect(screen, color, pygame.Rect(970, 230, 30, 500))
pygame.draw.circle(screen, (0, 0, 255), (x, y), 20)
print(str("x : {} , y : {}").format(x, y))
pygame.quit()