The Final Version Features
Hi, I just wanted to thank kfields, saluk for their comments on my game. I worked and improved the timing and have improved the ui for the key display just before the deadline :). Hope it is better than before. Check out the latest screen shots(log in to comment)
Comments
>>> import pygame >>> pygame.image.load('data/g_backdrop.png') Surface(640x480x24 SW)>so it looks to me like pygame is loading the image fine. Any other ideas why this might be happening?
In the case of 'Bob the Hamster', I would try
cd "/home/james/src/misc/pyweek6/RoboMinions-1.2 python run_game.py
cd "/home/james/src/misc/pyweek6/RoboMinions-1.2" python run_game.py
No, I was already inside "/home/james/src/misc/pyweek6/RoboMinions-1.2" when I run python run_game.py
Anyway, I found the problem. You level data is stored in text files with DOS line endings. (CR/LF) but for whatever reason, the CR is still there when the g_backdrop.png line read from data/l1.txt gets passed to load_img()
Here is the patch that I used to work around the problem.
--- lib/data.py.orig 2008-04-14 10:10:28.000000000 -0700 +++ lib/data.py 2008-04-14 10:10:40.000000000 -0700 @@ -32,7 +32,7 @@ return pygame.font.Font(os.path.join(data_dir, filename), size) def load_img(filename): - return pygame.image.load(os.path.join(data_dir, filename)) + return pygame.image.load(os.path.join(data_dir, filename.strip())) def get_fname(filename): return os.path.join(data_dir, filename)
Bob the Hamster on 2008/04/08 03:17:
When I try to run it, I get the following error: data/g_backdrop.png exists and is viewable.