« All Events
5:30 PM – Python Game Development – Bill
October 7, 2022 @ 5:30 pm - 6:30 pm
Today We:
- Continued to work on the Dragon Birdie project
- Created a new file for our Bird class
- Created a Bird class with the attributes: x, y, size
- Created the update method in the Bird class
- Cleaned up the code duplication with birds
- Made the birds have a random image loaded
Your HW:
- Create a new attribute in the Bird class called type, it will be the random number from the BIRD_ID list
- Create a new attribute in the Bird class called direction which needs to be a parameter in the __init__ method
- Make it a number
- In the update method check for the direction
- if it is 0, make the bird move to the right
- if it is 180, make the bird move to the left
- Do not worry about the birds flying backwards and trying to flip the images