A cool little effect. Made me practise classes
from kandinsky import fill_rect as rct from random import randint from time import sleep class Star: def __init__(self): self.x=randint(-160,160) self.y=randint(-110,110) self.z=randint(10,20)*0.1 def move(self): self.x/=self.z self.y/=self.z self.z+=0.2 p=[] for i in range(5):p.append(Star()) while True: rct(0,0,320,222,(0,0,0)) for s in p: if s.z>2:s.__init__() rct(int(s.x)+158,int(s.y)+108,4,4,(255,255,255)) s.move() sleep(0.05)