-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedited_sprit.py_important
More file actions
40 lines (27 loc) · 891 Bytes
/
edited_sprit.py_important
File metadata and controls
40 lines (27 loc) · 891 Bytes
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
'''controlls: up, down, left & right
exit: alt+esc'''
import pygame
pygame.init()
screen = pygame.display.set_mode([1000, 1000])
scree = pygame.display.set_caption ( "Moving Blue Cirlce Game")
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((255, 255, 255))
pygame.draw.circle(screen, (0, 0, 255), (x, y), 75)
print (str("x : {} , y : {}").format(x,y) )
pygame.display.flip()
pygame.quit()