This is documentation for the COMBOTS game, a game that pits two "combat robots" against each other to a fight to the finish.
The program was done to learn a little about how to detect a collision between objects and the method used in this instance was the POINT function in BASIC.
Each COMBOT may be programmed to perform ten actions, each action selected from a list of three possibilities, over and over again in the order determined at the time the COMBOT is programmed.
In order to simplify the shapes used to represent the COMBOTS there was nothing included to show "facing" of each COMBOT unless the unit is moving or firing.
Shapes are moved using the standard GET-PUT format after each shape is originally drawn using DATA statements to set the points and the colors.
Collisions (between the laser beams used as weapons and each combot) are detected by using the POINT function to read the color of each point in a straight line from the firing unit to the target point.
This target point is determined by extending a straight line from the firing unit's facing position point by point until either a color is detected or the absolute point reached is on the boundary of the field.
This point by point process is EXTREMELY slow and I suggest that an improved game would use a test against the current endpoint of the laser versus the actual points in the target unit. Also you could
compile the BASIC program for more speed.
Problems encountered with this program include the following:
1) Shapes "jumping" from one location to another, on top of each other. Apparently there was some error that caused the variable used to hold the current COMBOTs position not to be purged.
This would account for the "jump" to the other COMBOTs position for no apparent reason. I believe this is fully corrected now.
2) Colored points left on the screen due to COMBOTs attempting to move into the boundary. This was remedied by setting absolute limits to movements rather than depending on checking the color
of the point to be moved to. If such a colored point was hit by a laser the firing unit would thus score in error.
3) Colored points left on screen and/or boundary points shot away by the results of firing units hitting the colored boundary. This was patched rather than fixed. The patch simply redraws a small
inner portion of the colored boundary.
The game does everything I wanted it to do except that I wanted to have six COMBOTs on the screen at once. Until a better method is found to check for hits though this really isn't possible.