home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / POWERMAG / POWER16.MSA / POWER_16 / MISSMAKE.PWR < prev    next >
Text File  |  1985-11-20  |  12KB  |  257 lines

  1.  
  2. ---------------------------------------------------------------------------
  3.                      THE MISSING LINK MAKE PROGRAM
  4.  
  5.                            ARTICLE BY DEANO
  6. ---------------------------------------------------------------------------
  7.  
  8.  
  9.    The  missing link doc file talks about different kinds of  banks  for 
  10.    things such as bobs,  joeys,  blocks,  etc.  But how do we make those 
  11.    banks in the first place?  The answer is simple.  On the missing link 
  12.    disk is a file called MAKE.BAS. Note that only so much source appears 
  13.    with  the giveaway version of the package like this file,  so if  you 
  14.    have'nt registered then this file may be stored in PRG format on your 
  15.    copy of the package. Anyway let's have a look into it shall we?
  16.  
  17.    As  you may or may not know.....the missing link uses a new  type  of 
  18.    sprites known as bobs.  This are actually called pre-shifted sprites. 
  19.    The normal STOS sprites work like this......in order to get past  the 
  20.    problem of the ST's sixteen pixel boundary the sprite has to be  pre-
  21.    shifted.  This means so many copies of the sprite have to be made and 
  22.    each  one  is  scrolled by one pixel to the  right  until  there  are 
  23.    sixteen copies of one sprite image made before it goes on screen. 
  24.  
  25.    This  all has to be done before the sprite can be moved or placed  on 
  26.    screen in order to postion it anywhere on screen.  This takes a  fair 
  27.    bit of processor time which explains why sprites are often jerky  and 
  28.    slow. So the routine goes....make sixteen copies, place it on screen, 
  29.    make another sixteen copies, place it on screen at the next pixel and 
  30.    so on. But there is a better faster way of doing this.
  31.  
  32.    The difference with STOS sprites and pre-shifted sprites is that pre-
  33.    shifted  sprites are pre-shifted once and held in memory whilst  STOS 
  34.    sprites  are pre-shifted as they move across screen which means  they 
  35.    take up less memory than pre-shifted sprites. 
  36.  
  37.    Even  though  STOS sprites make sixteen images of themselves  we  can 
  38.    actually decided how many images of pre-shifted sprites are made.  We 
  39.    can make either 16,  8,  4,  2, or 1 image. Might you the less images 
  40.    you  use the more they jerk when moved.  This can be fixed by  moving 
  41.    them at different steps.  So we need to calculate how many pixels  to 
  42.    move  an image.  So if we wanted our sprite to move in steps  of  one 
  43.    pixel  we  would need to make sixteen images,  one for  each  of  the 
  44.    sixteen pixels of the boundary. This is worked out like this.
  45.  
  46.    16/1=16
  47.  
  48.    So we want to move the sprite at one pixel at a time so we divide  it 
  49.    by sixteen and we get the answer sixteen.  This means we have to make 
  50.    sixteen images of the sprite in order for it to be moved by one pixel 
  51.    at a time. Now lets suppose we wanted to move it by two pixels.
  52.  
  53.    16/2=8
  54.  
  55.    This  has now halved the size of the image because we're  now  moving 
  56.    the image at two pixels at a time so only halve of the images have to 
  57.    be made. Look at these other examples.
  58.  
  59.    16/4=4 : Move sprite at 4 pixels so make 4 images of each sprite.
  60.  
  61.    16/8=2 : Move sprite at 8 pixels so make 2 images of each sprite.
  62.    
  63.    So all we are doing is simply taking the number of pixels we want the 
  64.    sprite  to  scroll and dividing it by sixteen to found out  how  many 
  65.    images  we need to make.  Note that if your sprite is to move up  and 
  66.    down  the  screen  only then we only need to make one  image  as  the 
  67.    sixteen pixel boundary only applies to moving across the screen.
  68.  
  69.    But how do we make these images in the first place?  Well thats where 
  70.    the  MAKE program comes in.  First load it up and you  are  presented 
  71.    with  menus  covering  different convert  options.  The  one  we  are 
  72.    interested in at the moment is the one to convert our STOS sprites to 
  73.    pre-shifted sprites...in other words bobs.  From the LOAD menu  click 
  74.    on SPRITES and load your sprites.  Next go to the MAKE menu and click 
  75.    on MAKE BOBS. Here we see three options.
  76.  
  77.    MAKE BOBS
  78.  
  79.    IMAGES
  80.  
  81.    QUIT
  82.  
  83.    Before we convert the sprites to bobs we need to choose the number of 
  84.    images  we need of each one,  so postion the mouse pointer  over  the 
  85.    word  IMAGES and press the left mouse button.  You will now  see  the 
  86.    word  IMAGES with a number next to it and the word SPRITE above  that 
  87.    with its image number next to it.  Move the mouse pointer over either 
  88.    word  and click on either mouse key.  Notice how the left  and  right 
  89.    mouse buttons step through each number of each option.
  90.  
  91.    Select  sprite  one  and image four by clicking on  SPRITE  till  its 
  92.    number  says 1 and on IMAGES till it says 4.  This means we have  set 
  93.    MAKE  to make four images of sprite one.  If we wanted to  make  four 
  94.    images  of  all the sprites then we can simply click on  IMAGES  with 
  95.    both  mouse  buttons.  Note that if we now step through  the  sprites 
  96.    we see they are all set to be converted to four images each.
  97.  
  98.    Now  all  the images are set we can proceed to make them  into  bobs. 
  99.    Click on EXIT from the IMAGE selection screen and click on MAKE  BOBS 
  100.    to  start  the pre-shifting.  Note how MAKE shows  the  sprites  pre-
  101.    shifting on screen while its doing it.  How long it takes depends  on 
  102.    how many images are being pre-shifted.
  103.  
  104.    When  the program stops,  click on EXIT to go back to the main  menu. 
  105.    Our  sprites are now converted to bobs and all we have to do  now  is 
  106.    save them. From the SAVE menu click on BOBS and save them under their 
  107.    new name making sure the extension is .MBK.
  108.  
  109.    EG:- BOBS.MBK
  110.  
  111.    Its  important to remember that the more images made of  each  sprite 
  112.    the bigger the bank is so make sure theres enough room on  disk.  The 
  113.    MAKE program has just turned the sprite bank into a bob bank for  use 
  114.    with the bob commands. We can now use these bobs in a routine.
  115.  
  116.    10 key off : flash off : hide on : curs off : mode 0
  117.    20 rem ~~ First load the bob bank into memory bank 5
  118.    30 load "bobs.mbk",5
  119.    40 rem ~~ Place bob one on screen and move it along by 4 pixels
  120.    50 logic=back : XBOB=10 : YBOB=100
  121.    60 repeat
  122.    70 wash logic,XBOB-10,YBOB-10,XBOB,YBOB
  123.    80 bob logic,start(5),0,XBOB,YBOB,0
  124.    90 screen swap : wait vbl
  125.    100 XBOB=XBOB+4 : until XBOB>300
  126.  
  127.    This  routine loads our BOB bank into bank five and the rest  of  the 
  128.    routine zooms it across the screen, see how fast and smooth it moves? 
  129.    Notice also that unlike sprites the bobs can be placed into any  bank 
  130.    and they can either be loaded in every time the routine is run or  it 
  131.    can  be left in there without loading all the time.  The  reason  for 
  132.    WASH  and SCREEN SWAP is because unlike sprites the bobs don't  clear 
  133.    the  trail  behind them.  Notice also that WASH is set to  clear  ten 
  134.    pixels behind and over the sprite to ensure no trails are left.
  135.  
  136.    In  the  future I plan to do an article on moving and  animating  the 
  137.    bobs so watch out for that.
  138.  
  139.    Back  to  the  MAKE program.....we have  other  options  which  we'll 
  140.    discuss in turn.
  141.  
  142.    JOEYS
  143.  
  144.    The  method  for joeys are just the same as  bobs,  just  follow  the 
  145.    method for bobs to convert sprites to joeys.
  146.  
  147.    WORLD BLOCKS
  148.  
  149.    This  option will convert our sprites to world blocks so they can  be 
  150.    used by the world command. Same method as converting sprites to bobs.
  151.  
  152.    LANDSCAPE BLOCKS
  153.  
  154.    This  option  is  the  same as creating world  blocks  only  that  it 
  155.    converts  sprites  to  landscape blocks for use  with  the  landscape 
  156.    command.  Note that theres no IMAGES option for this option,  this is 
  157.    because  landscape only moves its blocks up and down the  screen  and 
  158.    the  sixteen pixel boundary does'nt exist here so theres no need  for 
  159.    pre-shifting. Just click on MAKE BLOCKS and save them.
  160.  
  161.    TILES
  162.  
  163.    Used by the tile and moziac commands.  This option works the same  as 
  164.    the bob option only that it creates tiles.
  165.  
  166.    Note  that these last four options all need to be saved with the  MBK 
  167.    extension,  like  BOBS they are converted into special banks so  they 
  168.    can be used by their commands. They are loaded in same way as bobs.
  169.  
  170.    PICTURE
  171.  
  172.    This option makes up a picture of your sprites, to active it you must 
  173.    first load the sprites then from the MAKE menu click on PICTURE,  the 
  174.    program will then place your sprites on screen in order one after the 
  175.    other  and  make up a picture.  You can then save  the  picture.  The 
  176.    sprites must be 16x16 in size.
  177.  
  178.    DIGIBANK
  179.  
  180.    Normally you can play a sample using the digiplay command but  should 
  181.    you be used to using STOS maestro then you may want to put a load  of 
  182.    samples into one bank then this is where this option comes  in.  Lets 
  183.    look at each option,  first from the MAKE menu click on DIGIBANK  and 
  184.    you'll  be  presented with a new options screen.  Note that  you  can 
  185.    either select a number or click on the option.
  186.  
  187.    LOAD SAMPLE
  188.  
  189.    Allows you to load a sample into the bank.
  190.  
  191.    SAVE SAMPLE
  192.  
  193.    Unlike  STOS maestro's accessory,  this option allows you to  save  a 
  194.    sample out of the bank and on disk as a stand alone sample.
  195.  
  196.    LOAD DIGIBANK
  197.  
  198.    When  you've saved a bank of samples,  it becomes a digibank  so  the 
  199.    digiplay  command can understand it.  This option allows you to  load 
  200.    the previously saved bank for editing.
  201.  
  202.    SAVE DIGIBANK
  203.  
  204.    Saves out a digibank for use with the command.
  205.  
  206.    CLEAR DIGIBANK
  207.  
  208.    Clears the digibank in memory, all samples are lost.
  209.  
  210.    PLAY SAMPLE
  211.  
  212.    Choosing  this option will take you to another  screen,  postion  the 
  213.    mouse  over the number and press either mouse key to  step  backwards 
  214.    and  forwards through the samples in memory.  To play it press  space 
  215.    and enter the speed.  Press space to play it and the sample will play 
  216.    in a loop. Press space again for the main menu.
  217.  
  218.    (UN)SIGN SAMPLE
  219.  
  220.    This  option will take you to the play screen.  From here select  the 
  221.    sample you wish to sign/unsign and press space for the main menu.
  222.  
  223.    EXIT
  224.  
  225.    Guess what........takes you back to the main menu.
  226.  
  227.    Once you've created your digibank and saved it you can play it  using 
  228.    the digiplay command like this.....
  229.  
  230.    digiplay 1,start(5),SAMPLE,10,1
  231.  
  232.    The parameter SAMPLE is normally used for the length of a raw sample. 
  233.    In this case it ranges from 0 to 49.  If the size is less than  fifty 
  234.    then  the  parameter SAMPLE is used for the number of the  sample  to 
  235.    play between 0 and 49. If SAMPLE equals more than 49 then the data in 
  236.    bank  five is assumed to be a raw sample but if its less  than  fifty 
  237.    then its assumed to be a digibank......examples.
  238.  
  239.    PLAY A RAW SAMPLE AT SPEED 10
  240.  
  241.    digiplay 1,start(5),32000,10,1
  242.  
  243.    PLAY A SAMPLE FROM A DIGIBANK AT SPEED 10
  244.  
  245.    digiplay 1,start(5),4,10,1
  246.  
  247.    In  order to put a digibank in a memory bank then just like  all  the 
  248.    other  new  created banks we save it as MBK and load it as  we  would 
  249.    load any MBK file.
  250.  
  251.    Well  thats  it for this article,  I will be doing one  on  the  EDDY 
  252.    program  soon so hopefully with that and this article you'll be  able 
  253.    to get creating some games with the missing link extension.
  254.  
  255.    This is Deano signing off.......(Ending nicked from Tony)
  256.  
  257.