Hello,
So, I'm very new to scripting languages and the like, and not *that* good with computers, so sorry if this is stuff that should be plain and simple to me. :-) I'm going to go step-by-step and explain what I've done, and hopefully someone can tell me where I'm going wrong. Also, some basic info: I'm running Windows XP Professional.
First, I downloaded and installed Python itself, version 2.4.4 (the "python-2.4.4.msi" file), from
python.org.
Second, I downloaded and ran the "pygame-1.7.1release.win32-py2.4.exe
" file.
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.
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.
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.