Skip to content
NEED SOME URGENT HELP: How do i fix this attribution error
Profile icon
ArtemisNightingale

this is a part of an entry for completion that's deadline is in a fed says. I had run into some errors and got some help from someone on this board. then I went I fixed the rest of it but now I am stuck on this attribution error that I don't know how to fix. This is the first time I am working with pygame, so I am pretty much a total beginner. any help again would be greatly appreciated.

Screenshot 2021-10-30 8.37.13 PM

You are viewing a single comment. View All
Profile icon
JustCoding123

In the Game class the function _init_ should be __init__.

Profile icon
ArtemisNightingale

@JustCoding123 I did that but now it says the Game object has no attribute up key, is it another typo I need to fix?

Profile icon
JustCoding123

@ArtemisNightingale Fixed it

def __init__(self): pygame.init() self.running, self.playing = True,False self.UP_KEY, self.DOWN_KEY, self.START_KEY, self.BACK_KEY = False, False, False, False self.DISPLAY_W, self.DISPLAY_H = 480,270 self.display=pygame.Surface((self.DISPLAY_W,self.DISPLAY_H)) self.window = pygame.display.set_mode(((self.DISPLAY_W,self.DISPLAY_H))) self.font_name = "8-BIT WONDER.TTF" self.BLUE,self.WHITE = (52,64,235),(255,255,255) self.main_menu = MainMenu(self) self.options = OptionsMenu(self) self.options = CreditsMenu(self) self.curr_menu = self.main_menu
Profile icon
ArtemisNightingale

@JustCoding123 thanks so much for the help! after I put in the changes you said and fixed the indention errors, I am now having a syntax error of line 2. I don't see the problem in it though?

Profile icon
JustCoding123

@ArtemisNightingale In the MainMenu class you again wrote _init_ and not __init__