Reputation: 21
I have the following error:
AttributeError: module 'pygame.display' has no attribute 'setmode'
Code:
import sys
import pygame
def run_game():
pygame.init()
screen = pygame.display.setmode((1200,800))
run_game()
I already verified the following:
What could be happening? I don't know what else I can do. I am using Windows
Upvotes: 0
Views: 1905
Reputation: 147
Try instead pygame.display.set_mode().
You have forgotten "_" between "set" and "mode"
import sys
import pygame
def run_game():
pygame.init()
screen = pygame.display.set_mode((1200,800))
run_game()
correct syntax!
Upvotes: 1