Hello,Hi!
First, I downloaded and installed Python itself, version 2.4.4 (the "python-2.4.4.msi" file), from python.org <http://python.org>.Good so far.
Yep, that's what you should do.
Second, I downloaded and ran the "pygame-1.7.1release.win32-py2.4.exe " file.
Yes. Basically what you're probably interested in are the \examples and the \docs directories. the rest of the stuff in that zip is just source, which you don't need because you installed pygame already.
Third, I downloaded the "pygame-1.7.1release.zip" file. However, I'm not sure where to extract this file to, and it looks like the "art assets" I need are there in the "pygame-1.7.1release\examples\data\ " directory.
Python searches a certain number of directories when it is looking for files. generally, it searches the current working directory first.
So anyway, from the tutorial (Lecture 3 at http://rene.f0o.com/mywiki/LectureThree), I typed the following into the Python command line:
>>> import pygame, sys,os >>> from pygame.locals import * >>> pygame.init() (6, 0) >>> window = pygame.display.set_mode((468, 60)) >>> pygame.display.set_caption ('Monkey Fever') >>> screen = pygame.display.get_surface() >>> monkey_head_file_name = os.path.join("data","chimp.bmp") >>> print monkey_head_file_name data\chimp.bmp >>> monkey_surface = pygame.image.load(monkey_head_file_name) Traceback (most recent call last): File "<stdin>", line 1, in ? pygame.error: Couldn't open data\chimp.bmp >>> screen.blit(monkey_surface, (0,0)) Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'monkey_surface' is not defined
Now, obviously, I know why this failed; 'monkey_surface' is not defined, because it failed to define itself in the "monkey_surface = pygame.image.load(monkey_head_file_name)" line. Pygame couldn't open the "chimp.bmp" file. The question is, where *should* this file be located, and why isn't it in the "C:\\Program Files\Pygame-Docs\examples\" directory, as it says it should be in the tutorial? Pygame isn't creating a directory called "C:\\Program Files\Pygame-Docs\examples\", and it looks like the stuff I need is in the " pygame-1.7.1release.zip" file; it seems like all I need to do is figure out where to put that data so that Pygame will recognize it.
you should be able to do everything from here. >>> pygame.image.load('data\\test.bmp') <Surface(160x120x24 SW)>
As a side note, the Pygame window doesn't seem to be initializing correctly; it just stays black, and when I mouseover it, I get the "hourglass" icon from Windows.Pygame needs calls to its display.update() method as well as clearing out the input queue to keep this from happening. You'll get to that later in the tutorial.
Anyway, thanks for any help anyone can provide, and, again, I'm sorry to be asking such simple questions, but I've tried for a week to work out what's gone wrong myself, and it seems better to ask the professionals at this point. :-)
I think you made the right choice :)
Thanks,
-Adam
You're welcome. -Luke