I'm having trouble getting my intro screen, defined by def game_intro(), to load properly. Whenever I run it, it just gets stuck on a blank, black screen. Before I added it, the game worked fine.
I've tried the debugger, but have not been able to successfully figure out what's wrong. I'm using the Python IDE to write the code. The problem code is below:
import pygame
import time
pygame.init()
scrWdt = 500
scrHgt = 500
win = pygame.display.set_mode((scrWdt,scrHgt))
pygame.display.set_caption("Snake")
clock = pygame.time.Clock()
black = (0, 0, 0)
def text_objects(text, font):
textSurface = font.render(text, True, black)
return textSurface, textSurface.get_rect()
def game_intro():
intro = True
while intro:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
win.fill(white)
largeText = pygame.font.Font('freesansbold.ttf',115)
TextSurf, TextRect = text_objects("Snake", largeText)
TextRect.center = ((scrWdt/2),(scrHgt/2))
win.blit(TextSurf, TextRect)
pygame.display.update()
clock.tick(100)
game_intro()
I want to see a white screen with the word "Snake" written on it.