home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
ST_PLUS
/
STP18.MSA
/
STP_INVAD_1A.STP
< prev
next >
Wrap
Text File
|
1997-06-30
|
4KB
|
116 lines
<PICLOAD>SPACE_1.DAJ
SPACE INVADERS TUTORIAL PT 1A
---------------------
BY CHRIS SWINSON
To help you in understanding some of the commands, I will write some Basic
example files so you can see for your self what is happening. I have started a
tutorial on how to write your own Space Invaders game. I shall explain each
section of the game in turn and also write each section into a small example
file. I have found in the past that large programs such as games can be very
difficult to understand. So I will break up the larger programs into small
easy to understand sections. Then put all the little files into one big
program. If you need any help with ANY command or need more example files or
want to have a chat about any thing then write to me. Don`t be afraid to ask
about anything. No matter how silly the problem may be. I like to think the
Mag is a service to STOS users. So make use of the service that I offer.
-----------------------------------------------------------------------
SCROLL EXPLAINED
------------------
To scroll the screen is rather simple. But choosing the most practical way is
far more difficult.
If you loaded a picture into a memory bank.....Eg
Reserve as datascreen 5
Bload "picture.PI1",5
You now have a picture in memory bank 5 to play with.
One of the most easiest commands to scroll the screen is to use the Def Scroll
command. If you wanted to Scroll the screen down you would type...
Screen copy 5 to logic
Def scroll 1,0,0 to 320,200,0,1
Scroll 1
The screen copy 5 to logic line will copy the picture in bank 5 to the TV
screen. The Def scroll line needs the following setting up...
1) The area or size of the screen to be moved.
2) The Direction of the screen to be moved.
3) How much to move the screen by.
Def scroll 1 , X , Y TO X1 , Y1 , XX , YY
Def scroll : Actual command instruction.
1 : Scroll zone number.
X,Y : Sets the top left hand corner of the screen
: 0,0 would be the very top left corner of the screen.
X1,Y1 : Bottom right hand corner of the screen.
: 320,200 is the very bottom left hand corner.
XX : Set to scroll left or right.
: Negative numbers to scroll left - ie -1
: Positive numbers to scroll right - ie 1
YY : Set to scroll up or down.
: Negative numbers to scroll up.
: positive numbers to scroll down.
Some example files can vbe obtained by writing to Deano at the address given in
his editorial.
If you wanted to loop scroll a screen or in other words move the screen but
have the same screen be moved over and over again without having a blank bit
at the top. You would scroll the whole screen down down 1 pixel line. Then
copy the very bottom pixel line to the very top of the screen. This is called
loop scrolling - see examples. The loop screen is used in the Space Invaders
game. In the game I have not use Def Scroll as it corrupts the screen and
makes the aliens judder.
The way I have used is to hold my screen in a bank. Then I have reserved a
temporary screen for my scrolling. To start the ball rolling..... You copy the
whole of the screen into a temporary bank. Then Screen Copy 5,0,0,320,200 to
5,0,1. This moves the whole of the screen down 1 pixel line.
<PICSHOWD>000,000,256,084,048
To move the aliens across the screen I have used the Move command. As its easy
to set up and quick to use.