- This event has passed.
9 AM – Python Game Development
August 29, 2020 @ 9:00 am - 10:00 am
- We randomize of which bird image to create.
- We went over how to delay the creation of birds in Birdie game.
- Next week is a labor day weekend, so no class.
- Homework:
- Inside cloud.py do the following
- Change BIRD_TYPE to CLOUD_TYPE and change the list element to cloud1, cloud2 and cloud3
- Chose a random element from this list so we can display a random image everytime.
- Change the code that would load the bird image into loading the cloud image. Replace the code that looks like this self.imageA = pygame.image.load(f”assets/{self.random_bird_type}_A.png”)
- Remove the code that would resize the bird.
- Inside main.py do the following
- on the top of the file, import cloud class. Look at how we imported the Bird class.
- Inside __init__ function, create cloud_group. Look at how we did bird_group.
- Create a function “create_cloud”. Look at how we did “create_bird” function. Create a new timer variable for cloud. Create “create_cloud_timer”. Don’t use create_bird_timer variable.
- Inside game_loop(),
- call create_cloud()
- call cloud_group.update()
- Inside cloud.py do the following