Hello, this is my first attempt at coding. I tried to run it but it wouldn't display?
#!/usr/bin/python import pygame from pygame.locals import * import time import sys import os from os import path # colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) YELLOW = (255, 255, 0) AQUA = (0, 255, 255) FUSCHIA = (255, 0, 255) GRAY = (128, 128, 128) LIME = (0, 255, 0) MAROON = (128, 0, 0) NAVYBLUE = (0, 0, 128) OLIVE = (128, 128, 0) PURPLE = (128, 0, 128) SILVER = (192, 192, 192) TEAL = (0, 128, 128) # main game starts here def main(): # Initialize screen and window pygame.init() screen = pygame.display.set_mode((720, 480)) pygame.display.set_caption('Times Tables Fun') # Fill background while intro: screen.fill(white) background = background.convert() background.fill((250, 250, 250)) # intro font = pygame.font.Font(None, 36) message_to_screen("Welcome to Times Tables fun!", TEAL, -100, "large") message_to_screen( "The objective of the game is to practice your times tables.", OLIVE, -30) message_to_screen( "Try to get as many questions correct as you can!", OLIVE, -10) pygame.display.update() clock.tick(15) time.sleep(2) font = pygame.font.Font(None, 18) text = font.render( "The goal is to practice your times tables." "Try to answer as many questions as correctly as you can!", 1, (10, 10, 10)) textpos = text.get_rect() textpos.centerx = background.get_rect().centerx background.blit(text, textpos) # Blit everything to the screen screen.blit(background, (0, 0)) pygame.display.flip() # Event loop running = True while running: # keep loop running at the right speed clock.tick(FPS) # Process input (events) for event in pygame.event.get(): # check for closing window if event.type == pygame.QUIT: running = False if event.type == pygame.KEYDOWN: # Figure out if it was an arrow key. If so # adjust speed. if event.key == pygame.K_LEFT: x_speed = -3 if event.key == pygame.K_RIGHT: x_speed = 3 if event.key == pygame.K_UP: y_speed = -3 if event.key == pygame.K_DOWN: y_speed = 3 # End!!! pygame.display.flip() # Limit fps clock.tick(60) # close window pygame.quit() sys.exit()