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 >
Text File  |  1997-06-30  |  4KB  |  116 lines

  1. <PICLOAD>SPACE_1.DAJ
  2.  
  3.  
  4.  
  5.                          SPACE INVADERS TUTORIAL PT 1A 
  6.                              --------------------- 
  7.                                 BY CHRIS SWINSON 
  8.  
  9. To  help you in understanding some of the commands,  I will write   some  Basic 
  10. example files so you can see for your self what is  happening. I have started a 
  11. tutorial  on how to write your own  Space Invaders game.  I shall explain  each 
  12. section  of the game in  turn and also write each section into a small  example 
  13. file.  I  have found in the past that large programs such as games can be  very 
  14. difficult  to understand.  So I will break up the larger  programs  into  small 
  15. easy  to  understand  sections.  Then put all  the little files  into  one  big 
  16. program.  If you need any help with  ANY command or need more example files  or 
  17. want to have a chat  about any thing then write to me.  Don`t be afraid to  ask 
  18. about  anything.  No matter how silly the problem may be.  I like to  think the 
  19. Mag is a service to STOS users. So make use of the  service that I offer.
  20.  
  21.  
  22.  
  23.  
  24.  
  25. ----------------------------------------------------------------------- 
  26.  
  27.                                 SCROLL EXPLAINED 
  28.                                ------------------ 
  29.  
  30. To scroll the screen is rather simple.  But choosing the most  practical way is 
  31. far more difficult.
  32.  
  33. If you loaded a picture into a memory bank.....Eg 
  34.  
  35. Reserve as datascreen 5 
  36.  
  37. Bload "picture.PI1",5 
  38.  
  39. You now have a picture in memory bank 5 to play with.
  40.  
  41.  
  42. One of the most easiest commands to scroll the screen is to use  the Def Scroll 
  43. command. If you wanted to Scroll the screen down  you would type...
  44.  
  45. Screen copy 5 to logic  
  46.  
  47. Def scroll 1,0,0 to 320,200,0,1 
  48.  
  49. Scroll 1 
  50.  
  51. The  screen  copy 5 to logic line will copy the picture in bank 5   to  the  TV 
  52. screen. The Def scroll line needs the following  setting up...
  53.  
  54. 1) The area or size of the screen to be moved.
  55.  
  56. 2) The Direction of the screen to be moved.
  57.  
  58. 3) How much to move the screen by.
  59.  
  60.  
  61. Def scroll 1 , X , Y  TO  X1 , Y1 , XX , YY
  62.  
  63. Def scroll : Actual command instruction.
  64.  
  65. 1          : Scroll zone number.
  66.  
  67. X,Y        : Sets the top left hand corner of the screen 
  68.            : 0,0 would be the very top left corner of the screen.
  69.  
  70. X1,Y1      : Bottom right hand corner of the screen.
  71.            : 320,200 is the very bottom left hand corner.
  72.  
  73. XX         : Set to scroll left or right.
  74.            : Negative numbers to scroll left - ie  -1  
  75.            : Positive numbers to scroll right - ie  1
  76.  
  77. YY         : Set to scroll up or down.
  78.            : Negative numbers to scroll up.
  79.            : positive numbers to scroll down.
  80.  
  81.  
  82. Some example files can vbe obtained by writing to Deano at the address given in 
  83. his editorial.
  84.  
  85. If  you wanted to loop scroll a screen or in other words move the   screen  but 
  86. have  the same screen be moved over and over again  without having a blank  bit 
  87. at  the top.  You would scroll the  whole screen down down 1 pixel  line.  Then 
  88. copy the very bottom  pixel line to the very top of the screen.  This is called 
  89. loop  scrolling - see examples.  The loop screen is used in the Space  Invaders 
  90. game.  In  the  game I have not use Def Scroll as it  corrupts the  screen  and 
  91. makes the aliens judder.
  92.  
  93. The  way I have used is to hold my screen in a bank.  Then I have   reserved  a 
  94. temporary screen for my scrolling. To start the ball  rolling..... You copy the 
  95. whole of the screen into a temporary  bank.  Then Screen Copy 5,0,0,320,200  to 
  96. 5,0,1. This moves the  whole of the screen down 1 pixel line.
  97.  
  98.  
  99. <PICSHOWD>000,000,256,084,048 
  100.  
  101.  
  102.  
  103.   
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. To move the aliens across the screen I have used the Move  command. As its easy 
  114. to set up and quick to use.
  115.  
  116.