American Young Coder Academy – Indo

Loading Events

« All Events

  • This event has passed.

5:30 PM – Python Game Development – Bill

October 7, 2022 @ 5:30 pm - 6:30 pm

Today We:
  1. Continued to work on the Dragon Birdie project
  2. Created a new file for our Bird class
  3. Created a Bird class with the attributes: x, y, size
  4. Created the update method in the Bird class
  5. Cleaned up the code duplication with birds
  6. Made the birds have a random image loaded
Your HW:
  1. Create a new attribute in the Bird class called type, it will be the random number from the BIRD_ID list
  2. 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

Details

Date:
October 7, 2022
Time:
5:30 pm - 6:30 pm
Verified by MonsterInsights