Easy Player Missile Graphics

by Roy Goring

 

Issue 32

Mar/Apr 88

Next Article >>

<< Prev Article

 

 

 

This issue we have a listing showing how easy it is to move Player/Missiles using the Turbo Basic commands MOVE and -MOVE. Just type in the listing using TURBO BASIC and RUN it. When you hear a beep, type in any message up to 26 characters long.


The program uses fairly standard Player Missile Graphics which have been explained in several other articles so I will only run through the commands used which are unique to TURBO BASIC.


Line 140: This line places zeroes in the player missile area, I used 20000 by trial and error to find an area of 2K which was not being used and therefore full of zeroes.
Lines 205-230: This moves the character data from the character set in ROM to the player 0 area. The data at the end of the program is in ATASCII character codes, you have to subtract 32 from this because the first character stored in the set is SPACE (ATASCII 32).
Line 245: Moves player 0 down.
Line 255: This takes the bottom byte and moves it to the top, which allows the player to scroll around the screen.
Lines 340-380: This uses REPEAT-UNTIL loops to move player 1 from left to right.
Lines 440-480: I have used WHILE-WEND loops to show the difference to REPEAT-UNTIL. In this case either can be used, but normally one of these would suit the job better.
Lines 520-555: Gets the characters typed in and places them in player 3. I have used an IF-EL SE-ENDIF to show how this can be used.
PROC MOVE: This is an endless loop with all the movements for all four players together. These are the only lines you need to actually move the players depending on which direction you want to go.


I hope this listing will give you the courage to use Player/Missiles in your Turbo BASIC programs, without having to worry about machine code.
 

  AtariLister - requires Java

 

CAN YOU WRITE TURBO PROGRAMS?

Don't forget we will pay 20 for an example of Turbo programming. The listing must be short enough to fit on one page and must use the features that are unique to Turbo Basic. You will have more success in getting your listing accepted if you choose an area of programming which has not already been covered. Send your contributions on disk to the Editorial address on page 3.

WHAT IS TURBO BASIC?

Turbo Basic is a powerful BASIC language for the Atari originally published in the German magazine Happy Computing who retain the copyright but have released the program to the public domain. It adds over 60 new commands to Atari Basic, runs three to five times as fast, yet is totally compatible with existing Atari Basic programs. It comes with a compiler that will compile any Atari Basic or Turbo Basic program to run at machine language speed.

You should be able to get a copy from any source of Public Domain software such as your local user group or the PAGE 6 Accessory Shop.

top