Hello I am new here and I just started working in python a month ago. I am working on a simple program to get a little red ball to follow my mouse around. I can find the error and I don't know what the error message it gives me means. Here is the code: [code]bif="pygame.jpg"
mif="ball.png"
import pygame ,sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((640,360),0,32)
background=pygame.image.load(pygame).convert()
mouse_c=pygame.image.load(ball).convert_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()[/code]
And here is the error I get[code]Traceback (most recent call last):
File "C:UsersAwesomePilotDocumentsProgrammingPythonPygame1gameSRC.py", line 9, in
background=pygame.image.load(pygame).convert()
error: Can't seek in this data source[/code]
If I hit run it acts like its gonna run for a second, then it freezes as a black window and the it doesn't respond. Please help Thank You![:) :)]()
mif="ball.png"
import pygame ,sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((640,360),0,32)
background=pygame.image.load(pygame).convert()
mouse_c=pygame.image.load(ball).convert_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()[/code]
And here is the error I get[code]Traceback (most recent call last):
File "C:UsersAwesomePilotDocumentsProgrammingPythonPygame1gameSRC.py", line 9, in
background=pygame.image.load(pygame).convert()
error: Can't seek in this data source[/code]
If I hit run it acts like its gonna run for a second, then it freezes as a black window and the it doesn't respond. Please help Thank You
