This topic is READ ONLY
britneyxoxo (1) [Avatar] Offline
#1
Hi Mr. Sande and Mr. Sande
I was trying to do the Chapter 10 Skier game program. I put the code in and stuff, but whenever I load, it says:

Traceback (most recent call last):
File "C:/Python25/Loop1.py", line 75, in <module>
skier = SkierClass()
File "C:/Python25/Loop1.py", line 8, in __init__
self.image = pygame.image.load("skier_down.png")
error: Couldn't open skier_down.png

I'm not sure if this is an issue with my code (I've checked the code several times)

Can you give me some advice?

Thank you!
warren.sande (211) [Avatar] Offline
#2
Re: Skier opening Issue
Most likely, you don't have the image files, or you don't have them in the same folder as the code.

By the way, in case you didn't notice the messages to that effect, this forum has moved. We don't actively monitor this one anymore.


- Warren
sunwuk0ng (1) [Avatar] Offline
#3
Re: Skier opening Issue
Hi Mr.Sande
I read the codes in Skier and there is a code that seems odd to me:
pygame.display.update(obstacles.draw(screen))
I search the guide from Pygame and known that pygame.display.update() receives an argument that is a rectangle or a series of rectangle.
I never see a function like obstacles.draw(screen) so I can not figure out how it work and the entire code works.
Could you explain this line of code for me?
Thanks a lot.
Best regards.