Question: I have a space shooter Python/Pygame game where a player shoots enemy ships. After about 5 minutes, enemies stop spawning. At this point I was

I have a space shooter Python/Pygame game where a player shoots enemy ships. After about 5 minutes, enemies stop spawning. At this point I was to have boss fight take place. But I cannot get the boss ship to spawn once the enemies have stopped spawning. I have a separate class for Boss and Enemies. Getting enemies to stop spawning was fairly easy but I cannot get the boss spawn to work at all. For example, to test I wrote

if pygame.time.get_ticks() > 5000:

boss = Boss()

all_sprites.add(boss)

but the boss never appears. I tried == as well. I also though of trying a USEREVENT but that occurs repeatedly.

How can I get this to work properly? Just for testing purposes I am keeping the time short but it will eventually be around 5 minutes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!