Bad Game version 0.0

badgame.zip
Source code
A txt link to the code in case your browser does stupid things to asm.

2005-04-28
Mr Raleigh Cross was kind enough to send me an improved version of the level editor. It adds some general user friendliness and command line parameters for setting the length of the level and double size rendering. Get it here (txt).
It requires a C99 capable compiler (use -std=c99 for gcc).

Notes on the game
This was my contribution to PDRoms Coding Competition 3. I began working on it as soon as the competition was announced. I drew the main sprite, wrote a bunch of bankswitching routines that were never used and then forgot about it. Three weeks before the deadline I got back to it and wrote the level editor. With one week to go I had the scrolling engine working and was busy debugging the collision code. Then I got horribly ill (from the flu bug presumably...) and was unable to do much at all for some three days.
  With only two days to go I had a basic platforming engine working and desperately needed to turn it into a game somehow. I added the bullets and the horribly buggy enemy spawning code. On the last day I got the enemies to fire vaguely in the direction of the player by writing what has to be the most atrociously bad aiming code ever and then duplicating huge amounts of old code until I got the bullets moving. After getting player and enemy deaths working I began building the level. Halfway through and with less than two hours to go the level design seemed lacking somehow. I decided to implement death by falling off the screen in order to get some variation. Of course, I ended up with the side effect "death by jumping off the top of the screen" too.
  I finished building the one and only level, added the name "Bad Game" and turned it in, 10 minutes before the deadline. I chose the name, not because I think the game is exceptionally bad, but because I set out to create something very good, perhaps even excellent, and this is just not it. Crud!

Notes on the source code
Unfortunately, no popular assembler will be able to handle it. At first I used xa for assembling, but it broke down after a while. I decided that I didn't have the time to learn something appropriate, like WLA DX or XORcyst and instead decided to assemble it by running TASM through Dosbox, the stupidest idea I've had in a long time. After writing the script that runs Dosbox and invokes TASM I realized that I was unable to get TASM to assign addresses to my global variables by itself. Having already written the wrapper script I figured I might as well turn it into some kind of preprocessor for memory allocation, the stupidest idea I'd had since the idea to run TASM under Dosbox. Consequently, the only way to get it to assemble is to install TASM and Dosbox and then run idiotasm.py.
And here's the txt link.
Of course, if you are running some kind of subpar operating system that actually allows you to execute TASM natively you might want to modify the script to do just that and skip Dosbox entirely. But then again, why would you want to run this crap at all? It's completely insane.


mapmake.c (.txt)
Notes on the level editor
The level editor is pretty decent. It's not very capable, horizontal scrolling only, tiles grouped together two by two, but it's very easy to use. It uses the Allegro library and requires two command line parameters, the first one is the name of the 4k pattern table and the second one is the name of the data file.
Some useful keys:
F5save
F7load
Ascroll left
Dscroll right
1,2,3,4choose palette
Escape,Qquit
What it saves is the level map (duh), the background palette and collision data. Collision data is stored as one byte per 16x16 tile indicating whether that tile is background, solid, solid from above or harmful. Right click on tiles in the pattern table to cycle through the different collision settings.

Notes on the txt links everywhere
I have come to realize that when I find source code on someones webpage, I usually don't want to use the code, I just want to look at it. Unfortunately, the webserver usually isn't smart enough to announce the file format as plain text when the extension is something other than .txt, and my browser is just as stupid. This bugs me to no end, and thus, to prevent a webpage of my own from bugging me to no end, I have included .txt-versions of all source files. These are of course just symlinks on the webserver and take up no extra space worth mentioning. Yay!

Johannes Holmberg, 2005
update dot uu dot se, johannes at