Skip to main content

asciisprites

Converts an ascii image to a polychrome pygame.Surface or a list of asciis to an animation.


miezebieze
(mieze)
Some time ago, I examined a game, where the data was completely plain text. All the images were stored in ascii strings and converted to an (monochrome) image.

I really dislike binary data, so I tried to make polychromatic images from a string and a dict with the colours. I didn't succeed at first...

Then, a week ago, I began with making a new game - And I really want to finish it; just to actually have something done! (My first try at a real game was not so successful.) So I dusted off this here (It was only a whole lot of None before.) and extended it. But then I wanted to make easy to control animations. So I made that and also classified the Image stuff, to have better control and easily recompile the image.

Examples are included. Just download and execute it.

Keys: Space, Left, Down, Right

Also the example has some more comments than needed, to be compatible with bloodier beginners than me.

Links

Home Page
http://www.pygame.org/

Releases

asciisprites 4 — 25 Mar, 2011

Pygame.org account Comments

  • djrahl 2012-09-05 19:24:45

    Thanks! This is a useful demonstration.

  • Diliupg 2015-05-25 05:54:44

    I get this error.

    IndexError: string index out of range

    at line 42