LDA $00

Contents

Intro

Alright, so the plan for this article is a quick rundown of the tic tac toe game for GameBoy that I programmed myself. It won't be much of a fun game since it's just tic tac toe but maybe it will give you an idea of what GameBoy development and how I made it. This is all written after I had made the game.

You can find my code for this project in this subdirectory of my gb repository on GitHub right here.

Plan of Action

So the plan was to make a tic tac toe game. That game that everyone knows how to play... And if your of average IQ, you can tie it everytime. It's solved I think? So really I made this as a foray into GameBoy development. It should be complete in that it has graphics, sound, AI, highscores, etc. It's a full package but just really boring and not extensive.

We wouldn't need much space to fit everything planned onto the smallest, most basic GameBoy cartridge. So I went for the ROM-only cartridge with no ROM banking. This gives us 32KB of ROM to use for a program. It means we can't save the highscores because there is no SRAM but if we were to only use it for a highscore, it's really pointless. It will be just like the arcade machines that reset the scores back to the default when you shut off the machines.

AI

The AI with tic tac toe is tricky... Not because it's hard to program a perfect one, but that if it's perfect, it's not fun at all (you can only ever tie). Who wants to play a game that they can only tie? So I made the AI with faults... The easiest way to do that was to make him randomly select a square that wasn't taken.

Sound

I used my own custom sound driver.