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

G Underground - 0.1

Matthew Stevens (matts)

Tags:

Description

This game is a little buggy as it was written in less than 24 hours, feedback is appreciated and I may be shamed into fixing the issues.

Links

Home Page: http://pyedpypers.org/pyday/
Source: http://www.fakepants.com/matts/main.py

Screenshot


click to view original size

Releases

G Underground - 0.1 - Jun 18, 2008

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

June 20, 2008 2:15pm - Matthew Stevens - nickname: (matts)
flummoxed: I created a png in the gimp. Then I used some python code to write out the string:

import zlib, base64
fp = open("Level1.png")
img_string = base64.b64encode(zlib.compress(fp.read()))
fp.close()

Then you can write img_string to a file, then use copy and paste to copy the content into image dictionary. I used vi and cat but it doesn't really matter.

This is the line where all the magic happens

surface = pygame.image.load(StringIO.StringIO(zlib.decompress(base64.b64decode(data[inaccessible_nodes_file]))),
inaccessible_nodes_file)

This decompresses the string that is in the dictionary and puts it in a file like object, that the imageg.load function uses to load the image into a surface. I pass the file name in so that pygame knows what file type the compressed data is, and it can apply the appropriate loader.

The level graphics is just a black and white image of where the walls are.
June 18, 2008 4:36pm - Allan Lavell - nickname: (flummoxed)
How did you use the level graphics without actually having the graphics attached to your game? I noticed the data dictionary that seems to have graphics somehow... could explain exactly what it is you're doing?
June 18, 2008 9:15am - pymike - nickname: (pymike)
That one was pretty cool :) Only things I had problems with were

1. move too slow
2. when you run out of rockets you have to die to replenish them

Really nice job for 24h :)
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Apr 16, 2014


Apr 13, 2014

Apr 9, 2014

Mar 18, 2014


Mar 15, 2014


Mar 14, 2014

Mar 13, 2014

Mar 11, 2014

Mar 9, 2014

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