★ AMSTRAD CPC ★ GAMESLIST ★ DOGFIGHT (c) AMSTRAD COMPUTER USER ★

Amstrad Computer User
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

Be a World War I flying ace with Alex Martin's simulation

Dogfight involves piloting a WWI fighter against the evil Blue Baron. You must manoeuvre your plane behind him to get a clear shot. Five hits from your machine gun is enough to destroy the aircraft. Ten Blue Barons must be shot down to win the game.
The game is for one or two players. If two, the second player takes over control of the Baron's plane. Joysticks are used, but this can easily be changed by altering the key numbers in line 90 to numbers shown in your manual.

Basic and machine code are used, the Basic part loading a binary file containing sprite routines and data. This is then Called to "log on" the RSXs, Sprite and Blank. These extensions are then used in the main Basic program to draw and erase the aircraft. RSXs are preceded by a " symbol. This is put into the program by '.

Typing in

Type in Listing I, the Basic part of the game, and save it on to a tape or disc. Reset and type in Listing II, the Basic program that creates the binary file. Save Listing II on to a separate tape in case of accidents. Run Listing II. If all is ok, the program will want to save the binary file. If you are using tape, save the file on the same tape as the Basic part of the game so that it loads when the game is run. When the game is running correctly Listing II can be deleted.

Make sure you do not type Is instead of Is in variable names. And save your work before attempting to run the program.
The variable diff, in line 100, controls the difficulty of the game against the computer. A value of 15 is challenging and difficult, 25 is much easier, 5 is impossible.

How it works

Lines 10 to 130 set up the program. First all variables are set to integers and then a break interrupt is set up that will put the computer into Mode 2 when Esc is pressed. Line 40 is the first important line. It sets up three functions which allow the coordinates of the planes to be incremented and decremented without worrying that the new coordinate is off the screen.

Line 50 sets up the screen with a graphics window. This stops the score from being shot down. Line 60 loads and calls the machine code if it hasn't been loaded already. 70, 80 and 90 set up the ink colours and the keynumbers.

In line 100 diff, as already mentioned, is the level of difficulty and d is the distance between each dot when the guns are fired. 110 to 130 sets up the sound envelopes and moves to the routine at 1170.

Lines 1170 to 1220 deal with the two-player option. First the various messages are printed and then a loop between 1190 and 1220 is entered. Only when either 1 or 2 has been pressed can the loop be exited.

The routine sets up the variable twoplayer to be either true (1) or false (0) and this is used to control the program later on. After leaving the routine, control is passed to line 1070.

Line 1070 clears the screen and prints the score by calling the routine at 1130. It then enters the main loop at 170. Lines 170 and 180 set up the variables ready for starting a dogfight. The x and y coordinates of the planes are set up and the damage is zeroed.

Line 190 makes engine drone noises according to how far up the screen the planes are. At line 200 the twoplayer variable is tested and, if true, the second of the two input routines is called and control skips to 240.

The lines that are skipped control the computer's plane. A direction is choseri at random. The variable rl controls how long the plane flies in that direc-
tion. When rl reaches zero the routine at 460 is called.

In 460 an initial random value between 1 and 5 is given to rl. Line 470 tests whether the computer's plane is behind the player's. If it is, a random direction for y is generated and the difficulty value is added to rl.

Control then passes to 490 and 500 where the x direction is set to home in on the player's plane and the flag to shoot at the player is set to true.
If the computers plane is in front of the player's, the computer's plane is put in reverse and a random sideways direction is generated. The routine then returns to the main loop.

Lines 220 and 230 use the directions set up for the computer's action. Short routines at 360 to 430 alter the coordinates. 220 changes the coordinates for left and right, while 230 changes them for up and down.

With the new coordinates set up, the main loop continues by calling the first input routine at 530.

The routine at 530 tests each key in turn. The variables up, down, left, right and fire contain key numbers for the directions of the joystick. If a switch is closed the relevant variable is altered and then control returns to the main loop.

Line 250 compares the old coordinates of the player's (or player one's) plane with its new coordinates. If they are different the plane must have moved.
If the plane has moved the old image is erased with Blank and the new drawn with Sprite. Even if the plane has not moved it is drawn again, as the other plane may have moved across it and erased part of it.

Line 260 does the same for the second plane. Line 270 then updates the old coordinates ready for next time around the loop.
Lines 280 to 300 concern shooting. The three variables shoot, shoot2 and shootS are used as flags. Shoot calls the routine at 790. This is the player's shot.
A loop of five iterations tests five points in front of the plane. The results of each test are added to the variable V. The shots are then plotted on the screen and then unplotted.

The sound command at 800 is slightly special as it uses a negative value for time. This makes the machine gun rattle out 10 rounds. At 830, if the computer's plane has been hit, a noise is made and the number of hits is incremented.

If there have been six hits the routine skips to 930, otherwise it returns to the main loop.

930 is the explosion routine for the Baron's plane. The score is incremented. 960 sets the endgame flag and jumps to 1130 to update the score and return to the main loop.
Meanwhile back in the main loop shoot2 is set for a computer controlled shot. If the Blue Baron's plane is close to player one's the routine for the computer's shot is called.

This is very similar to the player's shooting routine but sets the computer's action if a hit is made. If the plane is destroyed the explosion routine at 980 is entered.

For a two player game shoot3 is set when the second player's gun must be fired. When a plane is shot down the endgame flag is set and line 310 jumps to the end of game routine.

The routine at 1050 checks if either of the scores are 10 and prints a message if they are.
If someone has won the routine skips to 1090, which waits for a key press and then resets the game. If nobody has yet won the screen is cleared and the next round is started at 170.

If the game hasn't ended in line 310 the program loops back to 190 where everything happens again.

ACU #8703

DOGFIGHT
(c) AMSTRAD COMPUTER USER

AUTHOR: ALEXANDER MARTIN

★ YEAR: 1987
★ LANGUAGE:
★ GENRE: SIMULATION GAME
★ LiCENCE: LISTING
★ COLLECTION: AMSTRAD COMPUTER USER 1987

 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» DogfightDATE: 2013-07-21
DL: 222
TYPE: ZIP
SiZE: 6Ko
NOTE: Extended DSK/40 Cyls
.HFE: Χ

Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce jeu ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 230 millisecondes et consultée 1262 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.