First of all if you haven't played it (recently) you should and check it out: N0x35C49E and N0x35C49E source code
I built N0x35C49E to enter the iDevGames OMG contest. I wanted the "original OMG Cup T-shirt from iDevGames" which was for 4th, 5th or 6th place, Sadly (for me at least) but I didn't get that, I came 13th. It was fun though and pushed me to create the best game I made to that date.
The game starts up and once its loaded you see this:
Which is mainly a joke, but also describes the levels because I was hoping people wouldn't stop at the first level thinking it went on forever. That level was an asteroid field which you have to navigate through until the end.
The game is all ASCII art animations and pictures put together. It was fun seeing it all come into motion in-game. I used JavE for some of the graphics which is actually a really good program, especially for being made completly in java. It was particularly useful for making the asteroids because it has animation features.
I made my own file format .asciiart for this game which meant I could write loading code for the sprites once and it would be automated from then on. Here's an example of one of the files:
+--------------@---------------+------------------------------+ |______ ________ ______|000000 00000000 000000| | \__\ \ __/,'' '',\__ / /__/ | 000000 00111111111100 000000 | | ]\ / ,'| .. | , \ /[ | 0000001111111111000000 | @ ] | /| \\ .. // |\ | [ | 000000011111111110000000 | | \ / //| | .. | '\\ \ / | 000011111111111111110000 | | | // \ / .. \ / \\ | | 0000111111111111110000 | | | || //______\\ || | | 0000111111111111110000 | | |/ \ \________/ / \| | 0000011111111111100000 | | / || \__/ \__/ || \ | 000001111 111000000 | | \/\/\/ \/\/\/ | 000000 000000 | | |__| |__| | 0000 0000 | +------------------------------+------------------------------+
It's put inside a frame like that so I can extract the characters and the optional mask into individual data structures. The @'s represent the sprites origin location, so when I tell it to draw at (32, 45) for example the character at the @ will be in this position.
For the mask:
| Character | Graphics to be draw | Hit detection |
| ' ' | × | × |
| '0' | √ | × |
| '1' | √ | √ |
You can also have several of these frames (of different sizes) in one file which is how the different pieces of the crab are stored.
Was a very last minute thing I added, and on a tight deadline it was scary when it reduced the game to a crawl. It was because it was being drawn every frame by a lua script (80% of the game is written in lua). The HUD and score/lives was much better suited done in C so once I moved that from lua to C it all worked smoothly again to my relief.
Other things that are programmed in C instead of lua are bullet updating, all collision and hit detection, audio loading and the main draw loop. So anything difficult or CPU intensive. The way the drawing is actually done is the lua scripts send the asciiart files to the C engine, which adds each character to the position on a large grid. When it comes to rendering the screen after all the sprite data has been sent it loops through each cell of renders a textured quad which is a slice taken from the font image.
I should really make more levels, 1 full level is cool but not enough. I think also the game was way too hard, because when you are creating a game and testing each part of it over and over you get pretty good at it. I would love to make a much more complete sequel to this game using colored ANSI art instead of ASCII but I don't know of any ANSI editors that work on Mac, im also extremely lazy. so thats everything..