When i try to run this piece of code the pygame window created in the game_start function does not launch. When i remove the game_main_loop function it does. I cannot figure out what is wrong with the function, anybody have any ideas?
#Modules
import libtcodpy as libtcod
import pygame
#Game Files
import constants
pygame.init()
def game_start():
'''this function initialises the main window and the pygame library'''
#initialise the game
MAIN_SURFACE = pygame.display.set_mode((constants.WIDTH,constants.HEIGHT))
def game_main_loop():
'''in this function the game is looped'''
game_quit = False
while not game_quit:
#get player input
event_list = pygame.event.get()
#process player input
for event in event_list:
if event.type == pygame.QUIT:
game_quit = True
#draw the game
#quit the game
pygame.quit()
exit()