December 23rd, 2016, 12:37 AM
H-Tron: a little DOS game for the Hercules graphics card
I have recently written a little DOS game for the Hercules graphics card. It is the classical overhead view "Tron" game (motorcycles that leave "wall trails" behind them):
The game concept is simple: if you crash into a wall, your opponent scores one point. Who first reaches five points wins. The players' score is displayed in the top left and right corner (each line stands for one point).
You can choose between either one- or two-player-mode. Especially the one-player mode should be fun to play - it took me quite many attempts to beat the computer opponent for the first time.
I have included the source code, which - as you can see - is not too complicated. The game is written in Turbo C 2.01, which has the advantage over 1.0 that there is a delay() function for accurate timing. Therefore the game should run with the same speed on all systems from an original 4.77 MHz XT to DOSBox (it is *slightly* slower on 4.77 MHz, but still ok to play). Contact me if you need a Turbo C 1.0 version (for whatever reason).
Tell me what you think about the game, I hope you like it.
Merry Christmas to those who celebrate it!
Last edited by RobertK; December 24th, 2016 at 10:51 AM.
Reason: New version (VileR's issues 1 and 2)
December 23rd, 2016, 02:32 PM
"Device driver file not found (HERC.BGI)"
Easy enough to download but I think it's OK to bundle it with the game. I remember old DOS games being bundled with *.BGI files.
And the game is cute - I'm playing it now on a real 10MHz Hercules machine. Just needs the voice pack...
December 24th, 2016, 02:43 AM
Oops, I completely forgot the HERC.BGI driver. I have updated the zip file in the posting above, now it contains this file as well.
I was thinking about adding some beeper sound, but this would be maybe a little montonous (just engine sound and crash sound).
December 24th, 2016, 05:58 AM
Nice work! The computer player gives me a hard time, but not unfairly so- quite balanced overall.
Hope you don't mind a couple of comments:
1) After perhaps ten games or so, when I try to start another, it says "not enough memory to load driver" and drops me back to the prompt. A memory leak issue perhaps (is the BGI driver reloaded on each new game without its memory being deallocated first?)
2) It would be a nice touch to clear the keyboard buffer when a new round begins. Should prevent human players from starting with an unplanned turn due to a leftover keystroke.
Regardless, keep it up.. new games for oldskool PCs are always appreciated.
December 24th, 2016, 10:59 AM
December 25th, 2016, 02:04 PM
This is a fun game! Works great on an IBM 5150 PC with a 286 CPU Accelerator Card and Hercules Video to an IBM 5151 monitor. I will admit that I did have to re-read your post about the objective of the game (Don't hit the walls) so you might consider including that information in the welcome screen. Also, you might consider making the scoring tick marks a little larger or wider... so they can be more easily seen from a distance. Nice job!!
December 26th, 2016, 02:18 AM
@mmruzek: thanks for you comments, I have implemented both items.
The score is now displayed as text, which IMHO looks much better. The reason for the graphical display was that I was previously using Turbo C 1.0 with a custom graphics library that had no way to display text in graphics mode (note that graphics.h wasn't introduced until Turbo C 2.0).
I cannot edit my first posting anymore, so here is the new package attached.
December 26th, 2016, 02:19 PM
I have made two more changes:
1. Now the game always stays in graphics mode, because I fear that frequent switching between text mode and graphics mode could reduce the life expectancy of an old monitor.
2. Zero-player-mode added, that means now you can watch two computer players battling each other. I added this because it was easy to implement. Maybe I will later use this to make the game start in "attract mode".