Skip to content

Commit

Permalink
beta.etch.a.sketch
Browse files Browse the repository at this point in the history
First beta use arrow keys to draw with blue circle
  • Loading branch information
007bionicalman authored Apr 23, 2023
0 parents commit e0991cf
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions puck.only.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit e0991cf

Please sign in to comment.