This is a three player seek and destroy tank game. The players control a tank. They need to move it around the board, find the other tanks and shoot at them. The winner is the player with the least damage to their tank at the point when everybody gets bored.
The program contains several elements.
To play the game:
makebrdThis creates the game. It writes the coordinates, speeds, headings and damage of the tanks to a file called \\logogame\\oxo.txt
to makebrd |
The board uses an array of 21 numbers:
|
move1This uses dialog boxes to ask for the tank's new speed and heading. These are then written to the data file. The drawing program is then called to update the tank's position and redraw the board.
to move1 |
moveallThis moves all the vehicles at once. It is triggered by any player who has ordered their tank to move. Players need to move quickly if they are to keep up with the action.
to moveall |
draw1This shows the position of tank1 and anything else that it can see. It also decides if the tank's gun is pointing at anything.
to draw1 |
Notes on draw1.The current set of speeds and positions are read from the shared data file.
The difference in x coordinates and y coordinates is used to find the distance and bearing to the other vehicles.
If these are close enough then they are drawn on the map. fm1This repeats a move if the player is happy with the current heading and speed.
to fm1 scoreThis reads the data file and prints ou the current damage listing.
to score tankThis draws a tank using the player's colour.
to tank :col Download the code.If you already have LOGO running then this link might autorun the code. The best bet is probably to right click this link, save the code and then play with it in the normal way. You could run it through Notepad first to do the directory changes as needed. |