I've just downloaded python 3.3.2 and pygame-1.9.2a0.win32-py3.3.msi
.
I have decided to try a few tutorials on youtube and see if they work.
I have tried thenewboston's 'Game Development Tutorial - 2 - Basic Pygame Program' to see if it works. It is supposed to produce a black background and a ball that is the mouse (or so i think). It comes up with a syntax error when i try to run it, if i delete it it just produces a black pygame window. Here is the code:
bgg="bg.jpg"
ball="ball.png"
import pygame, sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((540,341),0,32)
background=pygame.image.load(bgg).convert()
mouse_c=pygame.image.load(ball).convert_alpha()
while True:
for event in pygame.event.get():
if event.type ==QUIT:
pygame.quit()
sys.exit()
screen.blit(background), (0,0))
The screen.blit(bakcgorund, (0,0))
command is the problem, when it comes up with the syntax error it highlights the second bracket on the furthest right of the command. If I delete it it just shows a black pygame window. can anyone help me?
I updated your code:
Your parenthesis are unbalanced; there are 2 opening parenthesis, and 3 closing parenthesis; that is one closing parenthesis too many:
You probably want to remove the closing parenthesis after
background
: