diff --git a/puck.only.py b/puck.only.py new file mode 100644 index 0000000..117f25b --- /dev/null +++ b/puck.only.py @@ -0,0 +1,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()