In this video we continue working on the Worm game started in #13, adding collision detection and the random placement of a digit on the screen for the player to guide the worm to. Next time, we’ll start by debugging why the digit is always 5 instead of randomly 1-8 and always appears in the third quadrant of the screen.
This series is undergoing a slight re-branding. When I started it, I was focused only on the 6502 microprocessor, which is found in many different computers and products from the 1980s (Commodore computers, Nintendo Entertainment System, Atari consoles, etc.) and is still in wide use today. But when it comes to writing programs that actually run on something, you have to program for a particular platform. While the 6502 itself doesn’t change, the methods of input/output, printing things on the display, memory management, and so on vary greatly from one 6502-based system to another.
In other words, if you write a 6502 routine to multiple two values in memory, you can use that unchanged on any 6502 system. If you want to print those values on the screen, send them to a printer, or save them to a disk file, then it matters what system you’re on.
So I will be (and have been) writing these programs for the Commodore 128, for three reasons. First, it’s the system I’m familiar with, having owned a few back in the day, and I always wanted to do more with it. Second, it’s the most powerful system that the VICE emulator does. Since I’m using an emulator anyway, I might as well use the emulated machine that has the most power and features. Third, there seem to be very few people out there programming for the C128. There’s a lot of activity around the C64, with new games and products popping up regularly, but very little for the C128. A new YouTube channel just appeared called Nybbles and Bytes, where she plans to convert a Javascript game she wrote to the C128, and her video and some comments on it made me realize this isn’t well-traveled territory.
Fourth (insert Monty Python bit), if I ever buy a real Commodore again, it will be a C128, and then my programs will run on it.
That means I’ll be expanding into some of the C128’s more unique features, like the 80-column screen and banked RAM. The programming will still all be 6502, but we will get deeper into the C128’s hardware and some cool stuff you can do with it.