When I try to run the game it freezes and I get an error.
bif = "bg.jpg" mif = "ball.png" import pygame, sys from pygame.locals import * pygame.init() screen = pygame.display.set_mode((800, 600), 0, 32) background = pygame.image.load(bif).covert() mouse_c = pygame.image.load(mif).covert_alpha() while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() screen.blit(background, (0, 0)) x, y = pygame.mouse.get_pos() x -= mouse_c.get_width()/2 y -= mouse_c.get_height()/2 screen.blit(mouse_c, (x, y)) pygame.display.update()
the Error Message:
Traceback (most recent call last): File "J:\Python\Game.py", line 10, in <module> background = pygame.image.load(bif).covert() AttributeError: 'pygame.Surface' object has no attribute 'covert'
If I comment out line 10, it has a similar problem with line 11, as well:
Traceback (most recent call last): File "J:\Python\Game.py", line 11, in <module> mouse_c = pygame.image.load(mif).covert_alpha() AttributeError: 'pygame.Surface' object has no attribute 'covert_alpha'
I'm using Python ver. 2.5.4 and Pygame ver. 2.5.4 for Windows (though I've tried many different versions of both, it hasn't solved the problem)
I have no idea what's wrong. Can someone please help? I'm very new, so if you know what my problem is I'd love it if you could explain it simply, and in depth. If it has something to do with the directory, please inform me as to where to access it/how exactly to edit it, so I can alleviate the problem (just to give a hypothetical example). Thanks.