Code runs fine, except the icon that I loaded is over written about four second after script starts. The icon is of a black mouse, its of the right size and all that. Whenit displays it is correct, but gets over written. This should not happen. Where is the code that is over writting my icon at?
import pygame import sys from pygame.locals import * pygame.init() # Constants FPS = 60 SCREENWIDTH = 400 SCREENHEIGHT = 300 DISPLAYSURFACE = pygame.display.set_mode((SCREENWIDTH, SCREENHEIGHT)) # functions, modules and classes while True: # main game loop # Open first surface icon = pygame.image.load('mouse_icon.png') pygame.display.set_icon(icon) pygame.display.set_caption('Darn Rats!') # This is where we put the code. for event in pygame.event.get(): # this is where events go if event.type == QUIT: pygame.quit() sys.exit() pygame.display.update()
This is quite interesting as the script does nothing but open a window and load the icon and the text.