My First Games

The first complete game I wrote was pretty much a clone of the popular commercial game, "Boulderdash". The object is to run around and collect a number of diamonds before an exit is opened allowing you to access the next stage. Diamonds and Boulders are pulled down the screen by gravity, however, the main character is not. If you get in the way of anything which is falling, it will squish you. So, you must be careful where you dig your tunnels, or you could create problems for your self rather quickly. This game was written somewhere around 1988. By this time, I had figured out the concept of "Character-Cell Animation" - the notion that you could animate a single character's image within the character-set memory, and that would "magically" animate the character where-ever it appeared on-screen, "for free". This realization was one thing that really pushed my productions beyond that which the other students were producing. The second really important thing I learned was how to "pan" the screen, or a region of the screen, around a large "map", at blistering speeds. Necessary for any form of scrolling game. I learned this trick from a magazine. I went over the code it demonstrated, many many many times, until I finally comprehended what it was doing. This was a difficult concept for me to understand, at the time (back in high-school).

This game was written in 100% 6502-assembly (using LADS). It ran slower than I would have liked (about 1/2 the desired framerate), however, I learned a lot. Sound effects and animation were few and far between, and no smooth scrolling existed.


My Second Game

This was the second complete game I wrote. It too was written in assembly. It featured custom character-graphics, horizontal smooth scrolling, sound effects, and animation. I made all the graphics, however, you'll be able to recognize a few things were copied pretty much pixel-for-pixel from other popular games (like the the main character, which was ripped-off from "Lode Runner"). The dynamite and the energy-pack were inspired by "Spellunker" :-) The other thing I remember copying was the small white dot which rotates on the ground. This represents a re-spawn point, and was inspired by "Rocket Roger". As you may notice on the title screen, the game was written for a Grade 12 Computer Class Project in 1989 - which means I was about 17 years old, and entirely self taught. Way ahead of the computer class instructors. This was also the first game I wrote, which actually contained any sound. I never liked to program C64 audio, it was too strange. Attack, Decay, Sustain, Release, Square Wave, Triangle Wave, Sawtooth, Noise. Volume, Filter, BLECH. Boy was I happy when I discovered the Amiga had "sound samples".

Title Screen
Fell too far and went squish
Mid-way through Level-1
Nearly Complete Level-1
Starting Level-2
Mid-way through Level-2

The game was assembled with the "LADS Assembler". This is an assembler which was published by Compute! ("The Second Book Of Machine Language"). The game took about 3 weeks to write (from what I recall) and occupied every spare minute of my time durring developement. I designed the program as a set of modules. Each module was a small block of assembly code, assembled from a separate file, and located at a specific location in memory. I spread out these modules sufficiently so that a module could grow without interfering with another (There is no automatic relocation in the C64). Looking back on it now, the design reminds me very much of the way a DLL or Library works (many independent modules a main program takes advantage of), as well as the way a modern compiler works (to make a change, you don't have to re-compile everything in the project, only the module which was affected by the change). I had previously developed several tools which this game relied upon to create the graphics, static screen artwork, and the maps. The character-set editor still works, as does the screen editor, however, my map editor disk seems to be corrupted now :-( I still have the source, so I may try to get it working again some time.


Tools

In order to write these games, I had to build some tools first. These tools had specific jobs, such as for building a level, editing grpahics/animation, and creating the static parts of the display. (I never wrote my own sprite editor, I used the one which was published by "Compute!" in the book "Commodore 64 Graphics"). Below are some screen-shots of one of the tools I wrote, the character-set editor.

Character-Set Editor
Help Screen
Editor

The idea was, you could cursor-around in the top windows, choose which character, and see a zoomed-in view of it in the WORK window, as well as the characters' POKE and ASCII values, start-address, etc. If you choose to edit the character, the cursor would move into the WORK window where you could modify it. A spare window, "Reference" was like a swap-box where you could store work temorarily, or apply special commands to, such as AND'ing the two images, OR'ing them, XOR'ing them, etc. The program supported all character-based display modes (HIRES, MULTI-COLOR, and EXTENDED), and allowed you to choose any available colors to work with. It was probably the best, and most useful program I ever wrote for the C64. Many a game idea was explored through the use of this editor, even if I never made it as far as writing the game itself. This tool was also written in assembly, and had instant on-screen feedback for anything you wanted to do (making it a feasable animation test-bed too).

Want to see what kind of code I wrote when I was in Grade 10? You can now view the source code for my various C64 applications! Don't hurt your brain trying to figure it out though. Apparently I didn't 'need' to comment anything, use meaningful variable names, use constants, or any of that other "bothersome" stuff.

Revisiting this code today, it blows my mind how much could be accomplished in only 500 lines of 8-bit assembler. It also blows my mind that I could keep track of how the whole program worked, with absolutely no comments or meaningful variable names what-so-ever. I was some sort of a freak of a coder. Oh, how I've changed (for the better, I hope!)


email to: rogermilne@shaw.ca
Home