American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

9 AM – Python Game Development

September 12, 2020 @ 9:00 am - 10:00 am

  1. We were able to integrate Cloud class into main.py so Cloud randomly appear on the screen.
  2. Homework:
    1. I have uploaded the latest files into google drive. Please download from there if you could not copy the code in the class.
    2. We want to make the bird appear from the right side of the screen and move to the left.
      1. Inside Bird.__init__ function, add another parameter: “direction”. direction could be either 90 (moving to the right) or 270 (moving to the left). Because we add a new parameter, in the main.py, when you create a new bird, you need to pass one more value. Look at inside main.py inside create_bird function. You should pass 270 for the direction parameter to make the bird move to the left.
      2. Save the direction parameter into self.direction.
      3. Inside Bird.update() function, if self.direction == 270, make the bird move to the left instead of going to the right. You have to change the self.x accordingly to make it move to the left. if  self.direction == 90, the bird should move to the right.

Details

Date:
September 12, 2020
Time:
9:00 am - 10:00 am
Event Categories:
,