When I shoot (shoot) an error appears, such as, well, there is no such array of bullets, such as there is no place for me to shove your cartridges! But at the same time, bullets seem to be clearly described. Is this some kind of mistake or do I have OOP spaces?
class player: def __init__(self, x, y, speed, max_bullets): self.bullets = [] self.x = x self.y = y self.speed = speed self.max_bullets = max_bullets def shoot(self, x, y): bullets.append(bullet(x, y, bullet_speed))