Please help me with this bug. I have python 3.0 and I was using pygame and for some reason it isn't reconizing
windowSurface
here Is the code Im having problems with and thanks in advance.
import pygame, sys, random
from pygame.locals import *
#*******************************************SETUPVAR**************************************************
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
ORANGE = (255,180,0)
YELLOW=(230,230,0)
def newscreen():
pygame.init()
mainClock = pygame.time.Clock()
windowSurface = pygame.display.set_mode((700,600), 0, 32)
pygame.display.set_caption('Test')
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
ORANGE = (255,180,0)
YELLOW=(230,230,0)
basicFont = pygame.font.SysFont(None, 48)
Font1 = pygame.font.SysFont('ActionIsShaded', 25)
windowSurface.fill(BLACK)
text = basicFont.render ('Test',False,WHITE,BLUE)
textRect = text.get_rect()
textRect.centerx = windowSurface.get_rect().centerx-100
textRect.centery = windowSurface.get_rect().centery-250
windowSurface.blit(text,textRect)
pygame.display.update()
def menu():
newscreen()
basicFont = pygame.font.SysFont(None, 48)
Font1 = pygame.font.SysFont('ActionIsShaded', 25)
one = basicFont.render('1', False, WHITE, RED)
two = basicFont.render('2',False,WHITE,GREEN)
three = basicFont.render('3',False,WHITE,ORANGE)
four = basicFont.render('4',False,WHITE,YELLOW)
threeRect = vl.get_rect()
threeRect.centerx = windowSurface.get_rect().centerx+200
threeRect.centery = windowSurface.get_rect().centery-10
twoRect = one.get_rect()
twoRect.centerx = windowSurface.get_rect().centerx-200
twoRect.centery = windowSurface.get_rect().centery-100
oneRect = text.get_rect()
oneRect.centerx = windowSurface.get_rect().centerx +200
oneRect.centery = windowSurface.get_rect().centery+150
oneRect.size = (100,100)
fourRect = end.get_rect()
fourendRect.centerx = windowSurface.get_rect().centerx-200
fourRect.centery = windowSurface.get_rect().centery+150
windowSurface.blit(one, oneRect)
windowSurface.blit(two,twoRect)
windowSurface.blit(three,threeRect)
windowSurface.blit(four,fourRect)
pygame.display.update()
menu()
# run the game loop
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()