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