Trying to add more boids by using mouse click ingame.
elif event.type == pygame.MOUSEBUTTONUP:
self.boids_group.add(boids.Boids(rect=pygame.Rect(random()*self.width, random()*self.height, 40, 40)))
I get an error msg that there is no object Boids in Boids, however this is the method i am adding boids to the game at start.
self.boids_group = pygame.sprite.Group()
for i in range(cfg.boidNum):
self.boids_group.add(boids.Boids(rect=pygame.Rect(random()*self.width, random()*self.height, 40, 40)))
And the cfg.boidNum is set to 19 at start, and its adding 19 boids, but not adding more when i push the mousebutton.
If anyone can guide me in the right direction....
The error msg i get when i try running is: line 69, there is no object Boids in Boids, line 69 ref to the mouse input line.