Post by Unbeliever on Mar 8, 2021 6:07:23 GMT
Well, here it is. My new c64 game: Pac Invaders.
Yes, there's an old Atari 2600 game with the same name. The Atari game has better gameplay; I have better graphics.
Attached below is my zipped my d64 file, containing the executable game, and two files of source code for Turbo Macro Pro.
To play the game: insert the d64 file into your c64 emulator, and: LOAD"*",8 and then RUN. (The machine code loads into BASIC memory and has one BASIC line to start it running.)
It's basically just a shooting gallery, nothing special. One row of targets that simply moves back and forth til you shoot them all, then they start a row closer, and faster. After five rows of the same enemy, you start a new "wave" of five rows, with a new enemy. After four waves, you start back with the first wave. Your only score is your hit/miss ratio, and your enemies can't shoot back. If you want to take a break, just walk away from the game; the enemies will be happy to wander back and forth until you're ready to shoot them some more.
Every single sprite is animated; even your shot. Every enemy type has its own explosion shape. There are simple sound effects for shooting, and explosions. I am very proud.
(I didn't bother with multicolor sprites; I wasn't using a sprite editor and didn't want the hassle.)
Non-programmers can stop reading here, and download the zip: Pac Invaders.d64.zip (16.42 KB)
OK, for anyone still reading. About the source:
First off, this is my first assembly program, ever. I think I was fairly clever in places, but I have no doubt that the design could be much improved. Constructive criticism welcome!
Both source files are SEQ files. Use backarrow-E to "Enter" (i.e. load) them into Turbo Macro Pro.
Pacinv.src is the main course code. It does an "include" of pacinv.sprites at the beginning, after setting a couple of compiler variables.
Pacinv.sprites contains the sprite data, and the BASIC loader. (The reason for this, is that the BASIC loader actually occupies the first sprite shape location, i.e. "sprite page 32".)
IMPORTANT -- BEFORE LOADING "PACINV.SPRITES" INTO TURBO MACRO PRO:
Pacinv.sprites is formatted a bit unusually. Before loading it into Turbo Macro Pro:
1) Do a backarrow-c for a cold start of TMP.
2) Move the cursor right three times (i.e. so it sits in the fourth column of the screen).
3) Type: backarrow-7, and then backarrow-8.
This will set the left margin to the correct location so you can load the file (with backarrow-E) without truncating the lines at the right margin.
You may be amused to see how I laid out my sprite data.
An overview of the main source file, "pacinv.src":
After we include the sprite file, there's...
1) A big storage area for all our constants and variables.
2) Title screen
3) Initialization section
4) Main loop (long)
6) Sprite code library
7) Sound code library
8) A dopey little debug message section that I added/removed when I needed to check certain variables.
All of the code, for better or worse, is 100% my own.
It is fairly well commented and easy to read, and I include it mainly because I think it could help other novice assembly programmers.
If you have any questions or comments about the code (or gameplay, I suppose), feel free to reply in this thread, and I'll do my best to answer them.
If you have any "ya shoulda done it THIS way, stupid" comments, I'm happy to take those too (though I'd appreciate it if you were more polite than that).
As I said: this is my first assembly project ever. My first playable game (well, outside of a handful of pathetic BASIC things, back in the 80's). My first animated sprites, my first sound effects. (Man, animating sprites is EASY compared to getting sound right in an action game!) So, you know, go easy on me...
Thanks for your interest.