class projectile(object): def int(self,x,y,radius,circle,color,facing): self.x = x self.y = y self.radius=radius self.color=color self.vel=8*facing def draw(win,self):
pygame.draw.circle(win,self.color,(self.x ,self.y),self.radius)
. . . . . for bullet in bullets: if bullet.x < 500 and bullet.x > 0: bullet.x += bullet.vel else: bullets.pop(bullets.index(bullet)) keys=pygame.key.get_pressed() if keys[pygame.K_SPACE]: if man.left: facing=1 else: facing=1 if len(bullets)<5: bullets.append( projectile (round(man.x + man.width//2),round(man.y + man.height//2),6,(0,0,0),facing) )