« All Events
9 AM – Python Game Development
October 10, 2020 @ 9:00 am - 10:00 am
- We were able to make the dragon flaps its wings by looping through 4 of its images/costumes.
- Homework:
- Right now the dragon is flapping its wing too fast. You need to make it flaps slower. How to make it slower:
- Inside main.py, look at how we made the creation of birds slower. Look at “create_bird(self): function on how we use “self.create_bird_timer”. Try to understand this code.
- Inside main.py, look at how we made the creation of clouds slower. Look at “create_cloud(self): function on how we use “self.create_cloud_timer”. Try to understand this code.
- Inside player.py:
- Inside __init__(), you need to create “self.flap_wing_timer = 10”
- Inside “update()” right now it is calling below code all the times
self.image = self.next_costume()
- Somehow by using timer you need to make call to above code less frequent.