Home

Hippo Teeth

For some time, I had been thinking about writing a game for the CoCo 1/2, something I had not done in more than 5 years.
And just as I was starting, "Retrochallenge RC2018/09" came around. I was unable to participate in previous editions, and I really wanted to be in this one.But the game I was working on was probably to big and complex to finish it on time.
I decided do a clone of sorts of an old hand-held LCD game I had back in the 80's, "Hippo Teeth", with the somewhat ambiguous goal of having it run in any CoCo with 16KB RAM.
You can read about the development in my blog, part 1, part 2, part 3, and ... part 3 again...
I wrote and tested the game using "VCC", a CoCo 3 emulator, and it was just some time later that I actually tested it in MESS. It was then that I realized that there is yet another "bug" in VCC, this time in the way that it handles keyboard detection.
Since I had to make some fixes, I went ahead and make a few changes and improvements.
In the end, I settled for having the game run in a 16 KB, Extended Color Basic CoCo - 32 KB if you want to use the disk version. It would not be hard to make it run in "regular" Color Basic, but the sound would not be that nice, and I just don't think it is a big deal.
The gameplay is quite simple. The cavity worm is eating the poor Hippo's teeth. You are the vet who is trying to get rid of the worm. If the tongue gets in your way, just spray somewhere else, to have the hippo move it away.
After you get 15 worms, there is a sort of "Bonus stage". For about 15-20 seconds the worm takes longer to eat the teeth, giving you an easier time.

COCO 3 COLORS


COCO 1/2 COLORS

Here is a .CAS file to play the game in a 16 KB CoCo, and a .DSK file for disk systems with at least 32 KB.
The game there is "compressed", that is, comments and most unnecessary spaces are removed, commands are crammed in a single line whenever possible, and lines are numbered 1 by 1. This makes it smaller and a bit faster, but also makes the code a lot hard to understand.
So, for all the comments below, I will refer to the "expanded" code.

Program Structure

Lines 10 to 25: Intro screen.
Lines 95 to 499: Main loop.
Lines 500 to 720: Draw and erase graphics.
Lines 790 to 850: Change a few settings while in "Bonus stage".
Lines 1000 to 1135: Initialize graphics and variables.
Line 1000: Check if CoCo 1/2 or CoCo 3.
Line 1020: Load the background graphics.
Line 1055: If replaying, return here without reloading all the graphics.
Lines 1060 to 1131: Load graphics.
Lines 2000 to 2050: Game over.

Variables

P(3,5): Print @ position for each of the 3 possible horizontal positions of the 5 lines that make up the player character.
P$(5): The 5 lines that make up the player character.
W(3,3): Print @ position for each of the 3 possible horizontal positions of the 3 lines that make up the worm character.
W$(3): The 3 lines that make up the worm character.
T(3,3): Print @ position for each of the 3 possible horizontal positions of the 3 lines that make up the tongue.
T$(3): The 3 lines that make up the tongue.
G(4,3): Print @ position for each of the 4 possible vertical positions of the 3 lines that make up the gas cloud.
G$(3): The 3 lines that make up the gas cloud.
CL$: 5 black spaces to delete text.
CB$: Used to delete the playe's feet.
D(1) to D(3): "Life" of each tooth.
DL: Speed at which the worm eats the tooth.
SI: How often to beep.
SC, HS: Score, High Score.
P,W,T: Player, worm and tongue position.
GV,GH: Gas cloud's vertical and horizontal position.

Other stuff

Here are some random facts about the game code.