American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

7PM Python Level 2

May 24, 2019 @ 6:00 pm - 7:00 pm

  1. We went over the concept of Object Oriented Language by introducing the concept of Class.
    1. We created a class called Bird. The Bird class has the following properties:
      1. x and y coordinates
      2. size
      3. direction
      4. imageA
      5. imageB
      6. update()
      7. next_costume()
    2. We converted the regular Bird code to a simpler code by using Bird class.
  2. Homework:
    1. Change Bird class to be able to make the bird do the following
      1. when direction is 90, make the bird move to the right.
      2. when direction is 270, make the bird move to the left
      3. In the constructor or __init__(), do the following
        1. if direction == 270:
             self.imageA = pygame.transform.flip(self.imageA, True, False)
             self.imageB = pygame.transform.flip(self.imageB, True, False)

Details

Date:
May 24, 2019
Time:
6:00 pm - 7:00 pm
Event Categories:
,