I thought that importing pygame and the sys module would suffice but it does not. I'm aware that self is not defined in my code. I'm using the a book for this project and the instructions are as follows:
import pygame
import sys
class AlienInvasion:
"""Overall class to manage assets and behavior"""
def __init__(self):
"""Initiaze the game, and create the game resources."""
pygame.init()
self.screen = pygame.display.set_mode((1200, 800))
when i run my code, I get a self not defined error. find below my code:
import pygame
import sys
class AlienInvasion:
"""Overall class to manage assets and behavior"""
def __init__(self):
"""Initiaze the game, and create the game resources."""
pygame.init()
self.screen = pygame.display.set_mode((1200, 800))
this is the error I get: