pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing

Spaceball 2000 - 1_1

jorgnsn (jorgnsn)

Tags:

Description

Fun puzzle game where your goal is to lead the Earth back to the sun, after CERN's particle accelerator sent it spinning through space. This is the first game we have ever made, and we think it has turned out pretty good. I have been coding for about 8 months and my brother has been doing graphics for about a year, it took us 6 months to make the game, we've really enjoyed it and hope you will have as much fun playing it as we had making it :) Finaly got around to make walkthroughs for the game: level 1-15 http://www.youtube.com/watch?v=5aeie5tNt_M level 16-30 http://www.youtube.com/watch?v=A1YcPeCcrRM

Changes

Improved compability on older macs, amongst lots of other small fixes. It's also easier to share levels over the internet with this version, its all done from within the game.

Links

Home Page: http://www.isavedtheearth.com
Source: http://source.isavedtheearth.com
Windows: http://win.isavedtheearth.com
Mac: http://mac.isavedtheearth.com

Screenshot


click to view original size

Releases

Spaceball 2000 - 1_1 - Dec 19, 2008
Spaceball 2000 - 1.0 - Dec 5, 2008

Comments

If you wish to leave a comment, please sign in first.

October 27, 2009 3:42pm - jorgnsn - nickname: (jorgnsn)
Finaly got around to make walkthroughs for the game: level 1-15 http://www.youtube.com/watch?v=5aeie5tNt_M level 16-30 http://www.youtube.com/watch?v=A1YcPeCcrRM
December 22, 2008 4:11am - Max Power - nickname: (paolo)
Indeed, i am running linux most of the time (BSD the other).
I already know how to fix that, since this it not the first time that i (or someone else) run into these kind of problems. That's why you should use os-path.

instead of

if sys.platform == 'darwin':
self.resourceFolder = 'Resources/'
self.levelFolderUser = self.resourceFolder + 'levels/user/'
self.levelFolderStory = self.resourceFolder + 'levels/story/'
else:
self.resourceFolder = 'Resources\\'
self.levelFolderUser = self.resourceFolder + 'levels\\user\\'
self.levelFolderStory = self.resourceFolder + 'levels\\story\\'

you can simply write

self.levelFolderUser = os.path.join("Resources","levels","user")
self.levelFolderStory = os.path.join("Resources","levels","story")

thats 2 lines of code vs. 8 lines of code.

Believe me, when i started programming, i had similiar problems, so why not use the powerful tools pygame offers?

Are you using some kind of IDE? I recommend eclipse/pydev to you, it will make your live much easier.

And yeah, that's really one of the messiest code i've ever seen ;)
When coding in python, i always catch myself not to observe the laws of OOP (like Encapsulation), which causes problems when a project is getting bigger and bigger....

Instead of using a class for storing the images, i would recommend to use a load-function and a dict:

def load_image(imagename):
try:
image = pygame.image.load(os.path.join("Ressources","images",imagename)).convert()
except pygame.error, message:
print 'Cannot load image:', name
raise SystemExit, message
return image

self.images={'moveableCube':load_image('Movable_cube.jpg'),
'metall':load_image(metall_640x640_img.jpg'),
'glass':load_image(glass_640x640_img.tga)
...}

Also try using PNG rather than TGA if you don't really really need TGA.

I wonder why nobody else is writing a comment, since your game is really good, the graphics are great, i like it!
December 19, 2008 4:15pm - jorgnsn - nickname: (jorgnsn)
Hey!
Thanks for getting back to me with the bug.
I only discovered how to split classes over sevral files when i was like 2-3 months into the project, so it's pretty messy code in general.

I presume you are running linux, i haven't got linux so it's hard for me to check that things are working there, i've got it running on some linux boxes, but it seem to be alot of different things going wrong on diffrent versions of
linux.
if you go to line 2226 you will see:
if sys.platform == 'darwin':
I think you will have to put in something like:
if sys.platform == 'darwin' or sys.platform.startswith('linux'):

Not sure if this will solve the problem, but it just might. I think the
sys.path.append worked on your system, it tries different things on diferent platforms to get it working, if not it should have printed that it could not append the path. see line 2294 for the sys.path.append stuff.

If you are not running linux, please post your system here, and i will try to sort it out for you. :)

December 19, 2008 1:46pm - Max Power - nickname: (paolo)
Traceback (most recent call last):
File "Spaceball 2000 V1_1.py", line 2392, in <module>
Root = root()
File "Spaceball 2000 V1_1.py", line 2239, in __init__
self.currentLevel = self.levelFolder + os.listdir(self.levelFolder)[1]## must be changed with config file
OSError: [Errno 2] No such file or directory: 'Resources\\levels\\story\\'

to access files, you should really really use os.path.join("first_folder","another_folder","the_file"), and try to avoid white-spaces in your filename. It's just to ugly to run $ python Spaceball\ 2000\ V1_1.py.

Try to split your classes over several files, that would really increase the readability of the code.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Feb 13, 2012

Jul 5, 2011

Apr 17, 2011

Apr 16, 2011

Apr 15, 2011


Apr 14, 2011



Apr 12, 2011

Apr 11, 2011


... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)