-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspirala.py
More file actions
33 lines (29 loc) · 753 Bytes
/
Copy pathspirala.py
File metadata and controls
33 lines (29 loc) · 753 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
import pygame as pg
import math
pg.init()
##Variabile
screen_width = 1920
screen_height = 1080
win = pg.display.set_mode((screen_width, screen_height))
x = 0
y = 0
angle = 0
radius = 0
win.fill((0, 0, 0))
run = True
draw = True
##Desenarea cercului
while run:
x = radius * math.cos(angle)
y = radius * math.sin(angle)
if -screen_width / 2 < x < screen_width / 2 and -screen_height / 2 < y < screen_height / 2 and draw:
pg.draw.circle(win, (255, 255, 255), (x + screen_width / 2, y + screen_height / 2), 2)
else:
draw = False
pg.display.update()
## Variabile desen
angle += 0.01
radius += 0.05
for event in pg.event.get():
if event.type == pg.QUIT:
run = False