-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
45 lines (38 loc) · 1020 Bytes
/
main.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
import pygame
import constants
# initialization pygame mode
pygame.init()
# This our surface
screen = pygame.display.set_mode(constants.size)
# This an icon (SHTO)
icon = pygame.image.load("jokerge.jpg")
pygame.display.set_icon(icon)
pygame.display.set_caption("Game of TheNaturals Pre-Alpha")
# flag of the circle
done = False
# FPS
clock = pygame.time.Clock()
def move(start) -> list:
keystate = pygame.key.get_pressed()
if keystate[pygame.K_UP]:
start[1] -= 5
elif keystate[pygame.K_DOWN]:
start[1] += 5
elif keystate[pygame.K_LEFT]:
start[0] -= 5
elif keystate[pygame.K_RIGHT]:
start[0] += 5
else:
return start
start_pos = [400, 200]
while not done:
clock.tick(constants.FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
screen.fill(constants.BLACK)
move(start_pos)
pygame.draw.circle(screen, constants.WHITE, start_pos, 14)
pygame.display.flip()
pygame.quit()
#pisipopi