« All Events
12 PM – Python Game Development
October 17, 2020 @ 12:00 pm - 1:00 pm
- Homework:
- In Flappy Duck project:
- Create a new file: score_line.py
- Inside the file, create a new class called ScoreLine.
- the class should inherits from pygame.sprite.Sprite.
- Inside the __init__,
- It would have parameters: x, y, height, screen
- create a self.rect (the hitbox) with width of 5 pixel and height from the parameter
- Inside the update() function, draw the rectangle on the screen.
- As a bonus point, you can try to integrate this sprite into main.py.