Target

Ken Woodward, Abertillery, Gwent

 

Issue 5

Sep/Oct 83

Next Article >>

<< Prev Article

 

You are represented in this game by a player on the right-hand side of the screen and the object is to obtain the best score possible by carefully aiming and firing each of your ten arrows at the target on the left. If you miss the board altogether you are given the opportunity to retrieve your arrow.

A hit in the outer ring records 200 points and the red ring scores 300. A bulls-eye is worth 500 but it is protected by a low-scoring green area worth only 100 points. Sounds easy, doesn't it? Oh, I forgot to mention that you are in constant motion and to make things even harder there are random speed changes at the extremes of your travel.

Press SELECT to choose one of the ten levels and START to begin to play. Press OPTION to review the highest score between games.

HOW IT WORKS

The main problem I encountered in writing this program was how to move Player Missiles up and down the screen at a reasonable speed in Basic. I found that it just could not be done and I have therefore used a machine language subroutine from an American magazine which moves Players during the Vertical Blank Interrupt. The code is poked into page six and is called only once with X=USR(1696). The subroutine then executes automatically every 50th of a second whilst the screen is off prior to being redrawn. Locations 1780-1783 become registers which hold the Y positions of each Player. If for example a 5 is POKEd into location 1780 then Player 1 will be moved to position X,5 instantly. Four players are supported but as you will see from the listing I have used only two (PLY and PLY+l). Horizontal movement is covered by using the normal X registers at 53248 and 53249 (PLX and PLX+I).

The program is well REMarked so you should have no trouble in following the code. Lines 1921 create the custom screen by altering the display list. The main loop of the program is between lines 160 and 195. Note the use of the POP command which should be used whenever you jump out of a FOR ... NEXT loop before the loop completes.

When writing programs I tend to use long variable names to make the listing easier to read. A couple of extra bytes are used when defining the variable but thereafter only one byte is used for any variable no matter what the length of the name.

I hope that you enjoy Target and that you learn a little from the listing. I have sent in my program, how about sending in one of yours? I like to type them in as well.

AtariLister - requires Java

top