American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

10 AM – Python Game Development

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

  1. I uploaded the latest FlappyDuck files into google drive under “SAT-10AM-PythonGameDevelopment” directory. You can download from here if you missed copying the codes.
  2. We delayed the creation of the Upside-down Tube.
  3. We randomize the height of the Upside-down Tube,
  4. We calculated the height of the Rightside-up Tube.
  5. Homework:
    1. Inside main.py, inside create_random_tube(self) function, you need to create the second Tube and add it to the tube_group.
      1. When creating the second Tube, you need to set the correct “y” coordinate because this is the Rightsideup Tube and you want this to appear on the bottom of the screen. You should use this formula to find the right y coordinate. y = HEIGHT – t2.
      2. Run it and make sure the second Tube appear on the bottom. It might not be rightside up, but that’s fine we are going to do that next.
    2. Inside Tube.py, you need to do the following
      1. Add one more parameter in the __init__ function, which is going to be “mode”. This mode can either be config.UPSIDE_DOWN_MODE or config.RIGHTSIDE_UP_MODE. When we add a new parameter in the __init__ function, don’t forget to change how you create the Tube inside main.py.
      2. If the “mode” is config.RIGHTSIDE_UP_MODE, you have to flip the image vertically. In the Birdie project, look at how we flip the bird.

Details

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