2

I'm just doing some development in pygame and I've run into some very strange trouble. This is my code:

import pygame, sys
from pygame.locals import *

#Declarin some variables
WINHEIGHT = 320
WINWIDTH = 640
red = (255, 0, 0)

pygame.init()
DISPLAY = pygame.display.set_mode((WINWIDTH, WINHEIGHT))
pygame.display.set_caption('My First PyGame')
FONT = pygame.font.Font(None, 32)

while True:

    pygame.draw.circle(DISPLAY, red, (100, 100)

    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()

I get an invalid syntax error on line 18 saying that

for event in pygame.event.get():
                               ^

Is a syntax error even though it isn't, help?

2 Answers 2

3

Note the line above:

pygame.draw.circle(DISPLAY, red, (100, 100)

You are missing a parenthesis:

pygame.draw.circle(DISPLAY, red, (100, 100))
Sign up to request clarification or add additional context in comments.

2 Comments

@NicholasWright Ha, don't - I'd be lying if I said I never got tripped up by that :)
If you're not using syntax highlighting, it helps with stuff like that.
1

You missed a ) in
Just put that (pygame.draw.circle(DISPLAY, red, (100, 100) # here!

1 Comment

Your second line seems to be copied from your answer to another question, and this answer is just a duplicate of @RocketDonkey's from a week ago, isn't it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.