You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You just signed up for a game development competition and now you need to represent sprites using Inheritance. But... wait a minute! Your team has made mistakes in the code and the inheritance is not working correctly. The due date is tomorrow. You need to save your team from being disqualified!
Your job is to fix the errors in the existing code.
These are the requirements for the program:
- Enemy must be a subclass of Sprite.
- Player must be a subclass of Sprite.
- Enemy must be a superclass of DifficultEnemy and HardEnemy.
Submit the working code to complete this mini project.
Tip: remember that subclasses inherit attributes from their superclasses.
"""
class Sprite:
def __init__(self, x, y, img_file, speed, life_counter):