home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 351-375 / apd375 / progs / parallax_scroll.amos / parallax_scroll.amosSourceCode
AMOS Source Code  |  1992-05-23  |  28KB  |  687 lines

  1. 'DATE: 14/01/92  
  2. 'TIME: 20:21 
  3. 'NAME: PARALLAX_SCROLL.AMOS  
  4. 'CODE: UNCLE SIME
  5. 'NOTE: YOU NEED THE CTEXT EXTENSIONS TO RUN THE INTRO PART UN_COMPILED 
  6. '      IF YOU HAVEN'T GOT CTEXT (GET IT) COMMENT OUT LINES 1 & 2 IN THE
  7. '      MODULE LEVEL CODE SECTION.
  8. 'THOUGHT FOR THE DAY:  Time Keeps On Slippin, Sllippin, Slippin, 
  9. '                      Into The Future.
  10. ' Loads of fun this one! As usual anyone that requires help drop me a
  11. ' note and I will try to help. INCLUDE RETURN POSTAGE OR YOU WILL NOT  
  12. ' GET A REPLY! 
  13. ' The Address:         Uncle Simes 
  14. '                      The Warehouse,
  15. '                      118 Hiltingbury Rd, 
  16. '                      Chandlers Ford, 
  17. '                      Eastleigh,
  18. '                      Hants.  
  19. '                      SO5 1NT 
  20. '     This is a quick message to Paul Townsend of Technical Fred software.   
  21. ' Hi Paul...The weird phone call you recieved last Saturday (25/01/92), where
  22. ' The caller asked to speak to Len was infact me, I called your number by  
  23. ' mistake and completely failed to realise that I had called You until later in
  24. ' the day, sorry about that. Liked your revolving Amos bob very nice. Must     
  25. ' Have a natter sometime, cheers Sime. 
  26. ' WHEN YOU SEE # IT MEANS LOOK IN THE REFERENCED PROCEDURE FOR EXPLINATION 
  27. '     * DATA SECTION (YEUCH! COBOL) - VARIABLES ETC *    
  28. ' 1] Set the correct disk / directory path 
  29. ' 2] Kill the system environment 
  30. ' 3] Declare a 1D array called Cloud$ with 4 elements  
  31. Dir$="SIMES_PROGS1:"
  32. Close Workbench 
  33. Close Editor 
  34. Screen Close 0
  35. Dim CLOUD$(4)
  36. '                       * MODULE LEVEL CODE *
  37. ' 1] Initialise the system for the intro 
  38. ' 2] Do the intro thing
  39. ' 3] Initialise the system for the demo  
  40. ' 4] Do the demo thing 
  41. ' 5] End of prog 
  42. INITIALISE_INTRO
  43. MAIN_INTRO
  44. ' No CTEXT then comment out above 2 lines
  45. INITIALISE_DEMO
  46. MAIN_DEMO
  47. End 
  48. '                  * INTRO PROCEDURE LEVEL CODE *
  49. Procedure MAIN_INTRO
  50.     '     This is the main intro procedure. i.e it controlls everything that 
  51.     ' goes on once the initialisation process has been completed. First  
  52.     ' I initialise all requited variables and strings. I then define a 
  53.     ' scroll zone for the scroll text. Next I make each of the screens 
  54.     ' visible. I then activate amal wich causes any amal programs to   
  55.     ' become active, I then change the autoback mode to 1 (half automatic  
  56.     ' screen copying mode Amos manual pages 158-161) finally I set Synchro 
  57.     ' off. This means that I must execute my Amal programs myself using a
  58.     ' loop with a call to Synchro (Amos manual page 202).  
  59.     '     We then enter the main loop. This loop controls the scroll text and  
  60.     ' the animation of the bobs over the rainbows to create the vu-meter effect.   
  61.     ' For a total description of how the scrolly text works see my program 
  62.     ' DUAL_PLAY.AMOS. The procedure stops when the end of TTEXT$ is reached
  63.     ' as this causes FINI to become = to 1 and results in the repeat until 
  64.     ' loop finishing.  
  65.     '     Once the scroll finishes I delete all rainbows, close all screens
  66.     ' fade out the music, erase any remaning memory banks and kill any bobs  
  67.     ' the procedure then ends and I start the initialisation process for the 
  68.     ' demo.
  69.     '
  70.     TTEXT$="                        AAAAAAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGGG!!!!!!!!!!!!  "
  71.     TTEXT$=TTEXT$+"WOTCHER GUYZ! I'M BACK..................YES UNCLE SIMES (THE OLD FART!) "
  72.     TTEXT$=TTEXT$+"IS BACK WITH ANOTHER PRODUCTION FOR ALL YOU CRAZED AMOS LOONIES TO RIP TO SHREDS "
  73.     TTEXT$=TTEXT$+"SO YOU CAN GET TO GRIPS WITH THIS AWESOME LANGUAGE!..........THIS IS AN INTRO "
  74.     TTEXT$=TTEXT$+"TO THE MAIN DEMO JUST SO THAT I CAN SAY A FEW HELLOS ETC. FIRST OF ALL EVERYTHING "
  75.     TTEXT$=TTEXT$+"ABOUT THIS INTRO AND THE MAIN DEMO IS EXPLAINED IN THE CODE....SO I WON'T "
  76.     TTEXT$=TTEXT$+"BOTHER EXPLANING ANYTHING HERE...................INSTEAD I WANT TO SAY THAT STING "
  77.     TTEXT$=TTEXT$+"HAS LOST HIS MARBLES AND STARTED SHOWING STRANGE FEELINGS OF AFFECTION "
  78.     TTEXT$=TTEXT$+"TOWARDS 386 BASED PC'S! SNAP OUT OF IT STING! YOUR WORKING TOO HARD MATE! REEEEEEEEEEELLLLLLAX "
  79.     TTEXT$=TTEXT$+"AND YOU WILL GET BETTER SOON (OTHERWISE IT'S BACK TO THE SCIENCE LAB!). "
  80.     TTEXT$=TTEXT$+"GREETINGS GO TO....AARON (WOTCHER CHIEF HOW'S LIFE DOWN THERE IN CIDER LAND?)."
  81.     TTEXT$=TTEXT$+"....SANDRA (GOOD TALKING TO YOU ON THE PHONE....GOT MY DISKS TA!)....ANNE AND LEN "
  82.     TTEXT$=TTEXT$+"(OVER WORKED AND UNDER PAID! HOPE YOU LIKE THIS ONE)....SOME OF THE POLY CREW...."
  83.     TTEXT$=TTEXT$+"MUM (THE MOT FAILURE....OOPS!)....SKIDDY AND SWEET CHEEKS....MATTY....JO....PACIFIC....RICK....JIM CAD...."
  84.     TTEXT$=TTEXT$+"JAX....ZOE....SAM....SARAH....MAJIC MUSHROOM....COLIN. GREETS TO....SYNTEX (BRILLIANT)....BITMAP...."
  85.     TTEXT$=TTEXT$+"HANISSIS V....BENSON....SPAGE....GARY (NICE ASSEMBLER GARRY 100 PERCENT! REAL SHAME ABOUT THE DOCS THOUGH!!!) "
  86.     TTEXT$=TTEXT$+"....RAY AT AMIGANUTS (GOT MY DISKS THANKS!) MARK MEANY ETC OF ACC (NOW THEY ARE REALLLLLLLY GOOD!!!) "
  87.     TTEXT$=TTEXT$+"..........HERE COMES THE NEXT BIT (LEFT BUTTOCK TO QUIT DEMO)....GOT TO DO SOME LOADING SO BE PATIENT! "
  88.     TTEXT$=TTEXT$+"SIMES OUT!                     "
  89.     LOCATION=0
  90.     SCRCOUNT=0
  91.     SCRSPEED=4
  92.     FINI=0
  93.     Screen 0
  94.     Def Scroll 1,0,0 To 384,22,-SCRSPEED,0
  95.     Wait Vbl 
  96.     For SCR=0 To 2
  97.         Screen Show SCR
  98.     Next SCR
  99.     Amal On 
  100.     Autoback 1
  101.     Synchro Off 
  102.     Wait Vbl 
  103.     Repeat 
  104.         Scroll 1
  105.         Add SCRCOUNT,SCRSPEED
  106.         If SCRCOUNT>22
  107.             Inc LOCATION
  108.             SCRCOUNT=0
  109.             If LOCATION>Len(TTEXT$)
  110.                 FINI=1
  111.             End If 
  112.              Extension_8_0006 349,22,Mid$(TTEXT$,LOCATION,1)
  113.         End If 
  114.         Wait Vbl 
  115.         Synchro 
  116.     Until FINI=1
  117.     Wait Vbl 
  118.     Rainbow Del 
  119.     For SCR=0 To 2
  120.         Screen Close SCR
  121.     Next SCR
  122.     MUZAK_DOWN
  123.     Erase 10
  124.     Erase 1
  125.     Bob Off 
  126. End Proc
  127. Procedure INITIALISE_INTRO
  128.     ' This procedure initialises the intro sequence. The following occurs
  129.     ' 1] I call the MUSIC_UP[PARAM1,PARAM2] procedure so that we get some sounds.
  130.     '    Notice that I have passed 2 parammeters to the procedure this time. 
  131.     '    The parameters are:-
  132.     '    PARAM1] The name of the music file I wish to load "IN QUOTES".  
  133.     '    PARAM2] The tempo at which I want the music to be played #. 
  134.     ' 2] I call the procedure SET_INTRO_SCROLL.      # 
  135.     ' 3] I call the procedure AMOS_INTRO_LOGO.       # 
  136.     ' 4] I call the procedure SET_INTRO_VU_METERS.   # 
  137.     ' 5] I call the procedure MOVE_INTRO_VU_METERS.  # 
  138.     Dreg(0)=Execall(-132)
  139.     MUZAK_UP["MUSIC/FAST_MUZAK.ABK",18]
  140.     SET_INTRO_SCROLL
  141.     AMOS_INTRO_LOGO
  142.     SET_INTRO_VU_METERS
  143.     MOVE_INTRO_VU_METERS
  144. End Proc
  145. Procedure SET_INTRO_SCROLL
  146.     ' Ok first of all put a nice rainbow effect on the screen. This  
  147.     ' rainbow is set up so that it will show through any parts of the  
  148.     ' font that are in colour 1. See SET RAINBOW command Page 139  
  149.     ' of your Amos manual. You will note the colour value in the instruction 
  150.     ' if you set this to 0 then the rainbow will show anywhere that is colour 0  
  151.     ' and so on, obviously you shouldnt set this to 32 if you have only opened 
  152.     ' a 16 colour screen.  
  153.     ' Next I put a rainbow infront of the scroll to give the illusion of depth.  
  154.     ' Word of warning:- In Amos you CAN NOT have 2 different rainbows on the 
  155.     ' same scan line if you try to do this one of your rainbows will vanish. 
  156.     ' Now I open a screen 348(X) long by 22(Y) wide with 8 colours and hide it.  
  157.     ' I then call SET_SCREEN # to initialise the screen and then the FONT_SET #
  158.     ' procedure to setup the CTEXT font. Finally I position the screen.
  159.     SCROL_RBOW
  160.     VU_FOREGROUND_RBOW
  161.     Screen Open 0,384,22,8,0
  162.     Screen Hide 0
  163.     SET_SCREEN
  164.     FONT_SET
  165.     Screen Display 0,128,240,320,
  166. End Proc
  167. Procedure AMOS_INTRO_LOGO
  168.     ' I have done this in a slightly wierd way because I was lazy! 
  169.     ' First I load a SPRITE / BOB bank. I then open a screen & hide it 
  170.     ' I then call SET_SCREEN #. Next I get the palette of colours associated 
  171.     ' with the sprite bank. I then put a rainbow on the screen that only 
  172.     ' shows through colour 1 (see SET_INTRO_SCROLL procedure). I then paste  
  173.     ' individual BOBS onto the screen.   
  174.     ' I should have loaded this a a picture (either .IFF or .ABK) but as I 
  175.     ' had each letter in a sprite file I didn't bother converting them back
  176.     ' to picture format. This however will give you the chance to see if you 
  177.     ' write some AMAL strings to bounce the letters up and down. Be careful  
  178.     ' or the scroll will flicker!  
  179.     Load Dir$+"SPRITES/SIMES3_SPRITES.ABK"
  180.     Screen Open 1,320,48,8,0
  181.     Screen Hide 1
  182.     SET_SCREEN
  183.     Get Sprite Palette 
  184.     AMOS_RBOW
  185.     Paste Bob 20,1,1
  186.     Paste Bob 57,1,2
  187.     Paste Bob 97,1,3
  188.     Paste Bob 134,1,4
  189.     Paste Bob 181,1,5
  190.     Paste Bob 218,1,3
  191.     Paste Bob 262,1,6
  192.     Paste Bob 290,21,7
  193. End Proc
  194. Procedure SET_INTRO_VU_METERS
  195.     ' This simply opens a screen and positions it. The bit to notice is  
  196.     ' where the vu bob is actually drawn and grabbed off of the current  
  197.     ' screen and placed into the sprite bank as BOB number 8.
  198.     Screen Open 2,320,42,2,0
  199.     Screen Hide 2
  200.     Screen Display 2,128,136,320,
  201.     Palette $0,$0
  202.     Ink 1
  203.     Bar 0,0 To 160,18
  204.     Get Bob 8,0,0 To 160,18
  205.     SET_SCREEN
  206. End Proc
  207. Procedure MOVE_INTRO_VU_METERS
  208.     ' This bit of code was originally written by CAPT Hickman in his   
  209.     ' AMOS DEMO II program. I have adapted it slightly to meet my  
  210.     ' requirements (NICE ONE SIR!).  
  211.     ' Right bit more complex this (don't panic). First Amreg(0) is set to    
  212.     ' = 12. Amreg like what's that..? ok Amos manual pages 193-194. Read them? 
  213.     ' ok so there are 26 registers (EXTERNAL REGISTERS 0-25) where Amreg(0)=RA,  
  214.     ' Amreg(1)=RB.......Amreg(25)=RZ. By Setting an amiga register to a specific   
  215.     ' value it becomes possible for us to reference the value from within an Amal  
  216.     ' string. Notice the Amal Move command (Manual Page 187) in each of the strings    
  217.     ' below. In every case the strings refrences RA/2 we know that RA=Amreg(0) 
  218.     ' we also know that in this case Amreg(0)=12, which means that every time  
  219.     ' the interpreter comes across RA/2  it substitutes the value 12 for RA and
  220.     ' devides it by 2 which just happens to = 6. Why not just put 6 in the string  
  221.     ' instead? Well it's easier to change the Amreg(0)= command than to have to change 
  222.     ' 4 amal strings.
  223.     ' Right I could go on to do a tutorial in amal at this point but I'm not going 
  224.     ' to unless enough people ask for one. If you have trouble understanding the 
  225.     ' Amal strings below read the chapter on amal in your manual, if your still
  226.     ' stuck then write to me and I'll try to help.   
  227.     ' Final point DO NOT CONFUSE EXTERNAL REGISTERS WITH INTERNAL REGISTERS see Amos 
  228.     ' manual pages 181-182 
  229.     ' After setting up the amal strings I put 4 bobs on the screen and assign    
  230.     ' them an Animation channel. I then assign each channel one of the 4 amal  
  231.     ' strings to execute.
  232.     ' Finally I put a rainbow on the screen. This is the rainbow over which the  
  233.     ' bobs move to produce the vu meter effect.
  234.     Amreg(0)=12
  235.     VU_1$="      Begin: Pause; Let R0=V(0);If R0=0 Jump Begin;"
  236.     VU_1$=VU_1$+"Move R0*2,0,RA/2; Move 0-R0*2,0,RA/2; ;P;P;P;P;P;P; Jump Begin;"
  237.     VU_2$="      Begin: Pause; Let R1=V(1);If R1=0 Jump Begin;"
  238.     VU_2$=VU_2$+"Move 0-R1*2,0,RA/2; Move R1*2,0,RA/2; ;P;P;P;P;P;P; Jump Begin;"
  239.     VU_3$="      Begin: Pause; Let R2=V(2);If R0=2 Jump Begin;"
  240.     VU_3$=VU_3$+"Move R2*2,0,RA/2; Move 0-R2*2,0,RA/2; ;P;P;P;P;P;P; Jump Begin;"
  241.     VU_4$="      Begin: Pause; Let R3=V(3);If R3=0 Jump Begin;"
  242.     VU_4$=VU_4$+"Move 0-R3*2,0,RA/2; Move R3*2,0,RA/2; ;P;P;P;P;P;P; Jump Begin;"
  243.     Bob 0,0,0,8
  244.     Bob 1,160,0,8
  245.     Bob 2,0,22,8
  246.     Bob 3,160,22,8
  247.     For LOP=0 To 3
  248.         Channel LOP To Bob LOP
  249.     Next LOP
  250.     Amal 0,VU_1$
  251.     Amal 1,VU_2$
  252.     Amal 2,VU_3$
  253.     Amal 3,VU_4$
  254.     VU_INTRO_RBOW
  255. End Proc
  256. '                  * MAIN DEMO PROCEDURE LEVEL CODE *
  257. Procedure MAIN_DEMO
  258.     ' This is the control loop for the main demo. The following occurs   
  259.     ' Set half-automatic screen copying mode. Make each screen visible 
  260.     ' and wait 100 * 1/50 of a second between showing each screen. Turn
  261.     ' off automatic bob updating. Move screen 6 to front of the display
  262.     ' (Amos manual page 129). Execute amal programs directly (synchro on 
  263.     ' Amos manual page 202). Activate all amal programs.   
  264.     ' The main loop deals with updating of the vu-meter and sime bobs. This  
  265.     ' is a double buffered display and conciquently requires manual synchro  
  266.     ' to produce a flicker free display in conjunction with all the amal programs  
  267.     ' (Amos manual pages 158-161). 
  268.     ' The process continues until the left mouse button is pressed. The system 
  269.     ' is then cleaned up, screens closed, memory banks erased and music  
  270.     ' turned off. The procedure then finishes and control returns to the main  
  271.     ' module where the End statement is encountered. 
  272.     Wait Vbl 
  273.     Wait Vbl 
  274.     Autoback 1
  275.     For LOP=0 To 6
  276.         Screen Show LOP
  277.         Wait 100
  278.     Next LOP
  279.     Wait Vbl 
  280.     Bob Update Off 
  281.     Wait Vbl 
  282.     Screen To Front 6
  283.     Wait Vbl 
  284.     Synchro On 
  285.     Wait Vbl 
  286.     Amal On 
  287.     Wait Vbl 
  288.     Repeat 
  289.         Screen Swap 
  290.         Wait Vbl 
  291.         Bob Clear 
  292.         Bob Draw 
  293.     Until Mouse Key=1
  294.     Amal Off 
  295.     Rainbow Del 
  296.     For LOP=0 To 6
  297.         Screen Close LOP
  298.         Wait Vbl 
  299.     Next LOP
  300.     Wait Vbl 
  301.     MUZAK_DOWN
  302.     Erase 1
  303.     Dreg(0)=Execall(-138)
  304. End Proc
  305. Procedure INITIALISE_DEMO
  306.     '     This procedure sets up the environment ready to run the main demo. 
  307.     ' First I deactivate automatic bob updating (Amos manual page 161). I then 
  308.     ' Load some music and fade it in by calling MUSIC_UP[] # Procedure. The next   
  309.     ' next 4 procedure calls are to a procedure called SET_CLOUDS[]. This procedure  
  310.     ' is called with 4 parameters. The parameters are as follows.  
  311.     '     1] FILE NAME "IN QUOTES" 
  312.     '     2] SCREEN NUMBER 
  313.     '     3] HEIGHT OF SCREEN (i.e Y value)  
  314.     '     4] Y POSITION OF SCREEN  (i.e display 15 down 40 down etc) 
  315.     ' I then set up the dual playfield that displays the Totally Amos logo 
  316.     ' and the mountains. I then animate the clouds by calling the procedure
  317.     ' MOVE_CLOUDS. I then animate the dual playfield by calling MOVE_D_PLAY_FIELD  
  318.     ' finally I set up and animate the vu-meters. See each procedure for   
  319.     ' appropriate explination. 
  320.     Bob Update Off 
  321.     MUZAK_UP["MUSIC/TRUEFAITH_MUZAK.ABK",18]
  322.     SET_CLOUDS["PICS/CLOUDS_1.ABK",2,24,40]
  323.     SET_CLOUDS["PICS/CLOUDS_2.ABK",3,13,64]
  324.     SET_CLOUDS["PICS/CLOUDS_3.ABK",4,16,77]
  325.     SET_CLOUDS["PICS/CLOUDS_4.ABK",5,11,93]
  326.     SET_D_PLAYFIELD
  327.     MOVE_CLOUDS
  328.     MOVE_D_PLAY_FIELD
  329.     SET_VU_METERS
  330.     MOVE_VU_METERS
  331. End Proc
  332. Procedure SET_CLOUDS[FILE$,SCR,SCR_Y,SCR_DISPLAY_Y]
  333.     ' This procedure is a good demonstration of just how usefull the 
  334.     ' ability to pass parameters can be, instead of having to write
  335.     ' four seperate procedures I have done the job with one procedure  
  336.     ' and four IN PARAMETERS that is to say the parameters are passed
  337.     ' into the procedure. Some of you may be confused about now so here
  338.     ' is a quick explination of parameter passing. 
  339.     ' In the procedure INITIALISE_DEMO you will see the following line:- 
  340.     '       1)   SET_CLOUDS["CLOUDS_1.ABK",2,24,40]  
  341.     ' This is a call to this procedure (SET_CLOUDS) if you now look at the     
  342.     ' procedure declaration above you will notice some square brackets []  
  343.     ' in which there are a load of variable names separated by commas (,)
  344.     ' i.e this :-  
  345.     '       2)   Procedure SET_CLOUDS[FILE$,SCR,SCR_Y,SCR_DISPLAY_Y].  
  346.     ' The values in the procedure call (1) are substituted into the empty
  347.     ' variables in the procedure (2) in the order in which they appear!  
  348.     ' Diagramatically this can be represented thus:- 
  349.     '       1)          CLOUDS["CLOUDS_1.ABK",2   ,24   ,40]     
  350.     '                                |        |    |     | 
  351.     '                                |        |    |     | 
  352.     '                                |        |    |     |   
  353.     '                                |        |    |     |   
  354.     '                                *        *    *     *         
  355.     '       2) Procedure SET_CLOUDS[FILE$   ,SCR,SCR_Y,SCR_DISPLAY_Y]. 
  356.     ' Notice also that the receiving variavles have MEANINGFULL names it   
  357.     ' may seem a good idea to call your variables A1,A2,A3 etc but in 3  
  358.     ' weeks time you won't have a clue what they do and anyone reading 
  359.     ' your code will have a hell of a time trying to work out what you 
  360.     ' are doing! 
  361.     ' The procedure then uses the data held in these variables to carry
  362.     ' out its job neat huh!. If anyone is still confused let Len or myself know  
  363.     ' and I'll do a tutorial on this subject.
  364.     ' The actual job of this procedure is to load the correct cloud file 
  365.     ' and screen copy the data to the correct screen and display it at the   
  366.     ' correct screen position. 
  367.     Load Dir$+FILE$,15
  368.     Unpack 15 To 7
  369.     Screen Hide 7
  370.     Screen Open SCR,640,SCR_Y,4,0
  371.     Screen Hide SCR
  372.     SET_SCREEN
  373.     Get Palette(7)
  374.     Screen Copy 7,0,0,320,30 To SCR,0,0
  375.     Screen Copy 7,0,0,320,30 To SCR,320,0
  376.     Erase 15
  377.     Screen Close 7
  378.     Screen Display SCR,128,SCR_DISPLAY_Y,320,
  379. End Proc
  380. Procedure SET_D_PLAYFIELD
  381.     ' This procedure is my standard way of setting up a dual playfield   
  382.     ' for a good explination see my programs TRANS_SCROLL.AMOS & 
  383.     ' DUAL_PLAY.AMOS 
  384.     Load Dir$+"PICS/MOUNTAINS2.ABK",15
  385.     Unpack 15 To 7
  386.     Screen Hide 7
  387.     Screen Open 0,640,54,8,0
  388.     Screen Hide 0
  389.     SET_SCREEN
  390.     Screen Copy 7,0,0,320,54 To 0,0,0
  391.     Screen Copy 7,0,0,320,54 To 0,320,0
  392.     Erase 15
  393.     Screen Close 7
  394.     Load Dir$+"PICS/TOT_AMOS.ABK",15
  395.     Unpack 15 To 7
  396.     Screen Hide 7
  397.     Screen Open 1,640,54,4,0
  398.     SET_SCREEN
  399.     Screen Copy 7,0,0,320,54 To 1,0,0
  400.     Screen Copy 7,0,0,320,54 To 1,320,0
  401.     Erase 15
  402.     Screen Close 7
  403.     Screen Display 0,128,104,320,
  404.     Screen Display 1,128,104,320,
  405.     Wait Vbl 
  406.     Dual Playfield 0,1
  407.     Dual Priority 1,0
  408.     Screen 0
  409.     Palette $0,$FFF,$CDF,$AAF,$88F,$55F,$33F,$0,$0,$0,$0,$0
  410.     Wait Vbl 
  411.     SKY_RBOW
  412. End Proc
  413. Procedure SET_VU_METERS
  414.     ' This procedure is almost identicle to the procedure SET_INTRO_VU_METERS  
  415.     ' see that procedure for an explination of whats happening 
  416.     Screen Open 6,218,64,2,0
  417.     Screen Hide 6
  418.     Screen Display 6,184,198,,64
  419.     Load Dir$+"SPRITES/PARALLAX_BOBS.ABK"
  420.     Wait Vbl 
  421.     Palette $0,$0
  422.     Ink 1
  423.     Bar 0,0 To 48,64
  424.     Get Bob 2,0,0 To 48,64
  425.     SET_SCREEN
  426.     Double Buffer 
  427.     VU_RBOW
  428.     VU_FOREGROUND_RBOW
  429. End Proc
  430. Procedure MOVE_CLOUDS
  431. Shared CLOUD$()
  432.     ' This procedure scrolls the clouds at the top of the screen. Notice that
  433.     ' the same Amal string is assigned to each screen but a different speed  
  434.     ' is assigned each time. The speed is read from the data statement at the
  435.     ' bottom of the procedure. Note Str$ converts the number held in 
  436.     ' in SCROLL_SPEED to a string (Amos manual page 59). 
  437.     For LOP=0 To 3
  438.         Read SCROL_SPEED
  439.         Channel LOP+2 To Screen Offset LOP+2
  440.         CLOUD$(LOP)="Begin:Let X=320;Loop: Let X=X-"+Str$(SCROL_SPEED)+"Pause;"
  441.         CLOUD$(LOP)=CLOUD$(LOP)+"If X>0 Jump Loop; Jump Begin;"
  442.         Amal LOP+2,CLOUD$(LOP)
  443.     Next LOP
  444.     Data 8,5,4,2
  445. End Proc
  446. Procedure MOVE_D_PLAY_FIELD
  447.     ' Previously I have moved dual playfields using hardware scrolling well
  448.     ' this time I have used Amal to animate both the screens. Fairly self
  449.     ' explinatory really.  
  450.     MOUNTAIN$="Begin: Let X=320; Loop: Let X=X-1; Pause; If X>0 Jump Loop; Jump Begin;"
  451.     T_AMOS$="Begin:Let X=1; Loop: Let X=X+8; Pause; If X<320 Jump Loop; Jump Begin;"
  452.     Channel 0 To Screen Offset 0
  453.     Amal 0,MOUNTAIN$
  454.     Channel 1 To Screen Offset 1
  455.     Amal 1,T_AMOS$
  456. End Proc
  457. Procedure MOVE_VU_METERS
  458.     ' See the procedure MOVE_INTO_VU_METERS for explination of this one.   
  459.     ' Note difference in Amal string Move command. ( X=0 here got it!) 
  460.     Amreg(0)=10
  461.     VU_1$="      Begin: P; Let R0=V(0);If R0=0 Jump Begin;"
  462.     VU_1$=VU_1$+"Move 0,0-R0,RA/2; Move 0,R0,RA/2 ;P;P;P;P;P; Jump Begin;"
  463.     VU_2$="      Begin: P; Let R1=V(1);If R1=0 Jump Begin;"
  464.     VU_2$=VU_2$+"Move 0,0-R1,RA/2; Move 0,R1,RA/2; P;P;P;P;P; Jump Begin;"
  465.     VU_3$="      Begin: P; Let R2=V(2);If R0=2 Jump Begin;"
  466.     VU_3$=VU_3$+"Move 0,0-R2,RA/2; Move 0,R2,RA/2; P;P;P;P;P; Jump Begin;"
  467.     VU_4$="      Begin: P; Let R3=V(3);If R3=0 Jump Begin;"
  468.     VU_4$=VU_4$+"Move 0,0-R3,RA/2; Move 0,R3,RA/2; P;P;P;P;P; Jump Begin;"
  469.     ' The 2 Amal strings Sime1$ and Sime2$ are responsible for the animated  
  470.     ' sime bob that appears infront of the vu meters (infront of the vu bobs 
  471.     ' because they have a higher priority than the vu bobs. Amos manual page 
  472.     ' 174. 
  473.     SIME1$="       Begin: Move 154,0,20; Move -154,0,20; Move 77,0,20;"
  474.     SIME1$=SIME1$+"For RB=1 To 50; Pause; Next RB; Move 0,-25,12;"
  475.     SIME1$=SIME1$+"Move 0,50,12; Move 0,-50,12; Move 0,25,12;"
  476.     SIME1$=SIME1$+"Move -77,0,20; Pause; Pause; Jump Begin;"
  477.     SIME2$="       Begin: Move -154,0,20; Move 154,0,20; Move -77,0,20;"
  478.     SIME2$=SIME2$+"For RB=1 To 50; Pause; Next RB; Move 0,25,12;"
  479.     SIME2$=SIME2$+"Move 0,-50,12; Move 0,50,12; Move 0,-25,12;"
  480.     SIME2$=SIME2$+"Move 77,0,20 ;Pause; Pause; Jump Begin;"
  481.     Hot Spot 1,$11
  482.     Bob 0,32,32,1
  483.     Bob 1,186,32,1
  484.     Bob 2,5,62,2
  485.     Bob 3,58,62,2
  486.     Bob 4,111,62,2
  487.     Bob 5,164,62,2
  488.     For LOP=0 To 5
  489.         Channel LOP+6 To Bob LOP
  490.     Next LOP
  491.     Amal 6,SIME1$
  492.     Amal 7,SIME2$
  493.     Amal 8,VU_1$
  494.     Amal 9,VU_2$
  495.     Amal 10,VU_3$
  496.     Amal 11,VU_4$
  497. End Proc
  498. '                  * GENERAL PROCEDURE LEVEL CODE *
  499. Procedure MUZAK_UP[NAME$,TMPO]
  500.     ' Loads the piece of music passed to it in the string NAME$ and plays  
  501.     ' it at the tempo passed to it in the variable TMPO. Gradually fades 
  502.     ' the music in.
  503.     Load Dir$+NAME$
  504.     Wait 1
  505.     Mvolume 0
  506.     Music 1
  507.     Led Off 
  508.     Tempo TMPO
  509.     For VOL=0 To 63
  510.         Wait 6
  511.         Mvolume VOL
  512.     Next VOL
  513. End Proc
  514. Procedure MUZAK_DOWN
  515.     ' Slowly fades out the current piece of music. 
  516.     For VOL=63 To 0 Step -1
  517.         Wait 3
  518.         Mvolume VOL
  519.     Next VOL
  520.     Music Off 
  521.     Erase 3
  522.     Wait Vbl 
  523. End Proc
  524. Procedure SET_SCREEN
  525.     ' Simple screen set procedure. stops flash effects, turns the cursor off 
  526.     ' hides the mouse pointer and clears the screen to colour 0  
  527.     Flash Off 
  528.     Curs Off 
  529.     Hide On 
  530.     Cls 0
  531. End Proc
  532. Procedure FONT_SET
  533.     ' This procedure sets up the system so it can use CTEXT fonts. If you
  534.     ' want to know more about CTEXT get a copy of Feburary 1992's Amiga  
  535.     ' Shopper, turn to page 109 and read Phil South's AMOS ACTION collum.
  536.     Load Dir$+"FONTS/TRANS_FNT2.ABK"
  537.     No Icon Mask 
  538.     Get Icon Palette 
  539.     Bank Swap 2,10
  540.     Wait 1
  541.     Bload Dir$+"FONTS/TRANS_FNT2.ABK.CFNT", Extension_8_0044 
  542.      Extension_8_0016 0,0
  543.     Erase 2
  544.     Wait Vbl 
  545. End Proc
  546. Procedure SCROL_RBOW
  547.     ' Rainbow for intro scroll text will appear on screen anywhere that
  548.     ' colour 1 is used. Created using Spages Rainbow Warrior Prog. 
  549.     Set Rainbow 0,1,36,"","",""
  550.     Rainbow 0,0,226,36
  551.     Colour Back 0
  552.     Restore RDATA
  553.     For C=0 To 35
  554.         Read CVA
  555.         Rain(0,C)=CVA
  556.     Next C
  557.     View 
  558.     RDATA:
  559.     Data $0,$0,$0,$0,$0,$0,$D5F,$D5F
  560.     Data $D5F,$D5F,$C5F,$C5F,$C5F,$C5F,$B5F,$B5F
  561.     Data $B5F,$B5F,$A5F,$A5F,$A5F,$A5F,$95F,$95F
  562.     Data $95F,$95F,$85F,$85F,$85F,$85F,$75F,$75F
  563.     Data $75F,$75F,$65F,$65F
  564. End Proc
  565. Procedure AMOS_RBOW
  566.     ' Rainbow for AMOS NO 1. Logo in intro will appear on screen   
  567.     ' anywhere that colour 1 is used. Created using Spages Rainbow Warrior   
  568.     ' prog.
  569.     Set Rainbow 1,1,115,"","",""
  570.     Rainbow 1,0,0,100
  571.     Colour Back 0
  572.     Restore RDATA
  573.     For C=0 To 114
  574.         Read CVA
  575.         Rain(1,C)=CVA
  576.     Next C
  577.     View 
  578.     RDATA:
  579.     Data $EFF,$EFF,$EFF,$DFF,$DFF,$CFF,$CFF,$BFF
  580.     Data $BFF,$AFF,$AFF,$9FF,$9FF,$8FF,$8FF,$7FF
  581.     Data $7FF,$6FF,$6FF,$5FF,$5FF,$4FF,$4FF,$3FF
  582.     Data $3FF,$2FF,$2FF,$1FF,$1FF,$EF,$EF,$DF
  583.     Data $DF,$CF,$CF,$BF,$BF,$AF,$AF,$9F
  584.     Data $9F,$8F,$8F,$7F,$7F,$6F,$6F,$5F
  585.     Data $5F,$4F,$4F,$3F,$3F,$2F,$2F,$1F
  586.     Data $1F,$1F,$12F,$1F,$1F,$1F,$2F,$2F
  587.     Data $3F,$3F,$4F,$4F,$5F,$5F,$6F,$6F
  588.     Data $7F,$7F,$8F,$8F,$9F,$9F,$AF,$AF
  589.     Data $BF,$BF,$CF,$CF,$DF,$DF,$EF,$EF
  590.     Data $1FF,$1FF,$2FF,$2FF,$3FF,$3FF,$4FF,$4FF
  591.     Data $5FF,$5FF,$6FF,$6FF,$7FF,$7FF,$8FF,$8FF
  592.     Data $9FF,$9FF,$AFF,$AFF,$BFF,$BFF,$CFF,$CFF
  593.     Data $DFF,$DFF,$EFF,$EFF,$EFF,$0,$0,$0
  594. End Proc
  595. Procedure SKY_RBOW
  596.     ' Rainbow for background of dual playfield in main demo will appear on 
  597.     ' screen anywhere that colour 0 is used. Created using Spages Rainbow  
  598.     ' Warrior prog and changed by hand.
  599.     Set Rainbow 0,7,56,"","",""
  600.     Rainbow 0,0,103,56
  601.     Colour Back 0
  602.     Restore RDATA
  603.     For C=0 To 55
  604.         Read CVA
  605.         Rain(0,C)=CVA
  606.     Next C
  607.     View 
  608.     RDATA:
  609.     Data $11E,$11E,$11E,$11E,$22E,$22E,$22E,$22E
  610.     Data $33E,$33E,$33E,$33E,$44E,$44E,$44E,$44E
  611.     Data $55E,$55E,$55E,$55E,$66E,$66E,$66E,$66E
  612.     Data $77E,$77E,$77E,$77E,$88E,$88E,$88E,$88E
  613.     Data $99E,$99E,$99E,$99E,$AAE,$AAE,$AAE,$AAE
  614.     Data $BBE,$BBE,$BBE,$BBE,$CCF,$CCF,$CCF,$CCF
  615.     Data $DDE,$DDE,$DDE,$DDE,$EEF,$EEF,$EEF,$EEF
  616. End Proc
  617. '
  618. Procedure VU_RBOW
  619.     ' Rainbow for vu-meters in main demo will appear on screen anywhere  
  620.     ' that colour 1 is used i.e bobs are drawn in colour 1. Created using  
  621.     ' Spages Rainbow Warrior prog.   
  622.     Set Rainbow 1,1,64,"","",""
  623.     Rainbow 1,0,198,64
  624.     Colour Back 0
  625.     Restore RDATA
  626.     For C=0 To 63
  627.         Read CVA
  628.         Rain(1,C)=CVA
  629.     Next C
  630.     View 
  631.     RDATA:
  632.     Data $F6F,$F6F
  633.     Data $F5F,$F5F,$F5F,$F5F,$F3F,$F3F,$F3F,$F3F
  634.     Data $F2F,$F2F,$F2F,$F2F,$F1F,$F1F,$F1F,$F1F
  635.     Data $F0F,$F0F,$F0F,$E0F,$E0F,$E0F,$E0F,$D0F
  636.     Data $D0F,$D0F,$C0F,$C0F,$C0F,$C0F,$C0F,$B0F
  637.     Data $B0F,$B0F,$B0F,$A0F,$A0F,$A0F,$A0F,$90F
  638.     Data $90F,$90F,$90F,$80F,$80F,$80F,$80F,$70F
  639.     Data $70F,$70F,$70F,$60F,$60F,$60F,$60F,$50F
  640.     Data $50F,$50F,$40F,$40F,$40F,$40F
  641. End Proc
  642. Procedure VU_INTRO_RBOW
  643.     ' Rainbow for vu-meters in in will appear on screen anywhere   
  644.     ' that colour 0 is used i.e bobs are drawn in colour 1 placed over 
  645.     ' the top of the rainbow so it can not be seen. When annimated the bobs
  646.     ' move off the rainbow which as a result appears on the screen. Created  
  647.     ' using Spages Rainbow Warrior prog.   
  648.     Set Rainbow 3,0,42,"","",""
  649.     Rainbow 3,0,135,42
  650.     Colour Back 0
  651.     Restore RDATA
  652.     For C=0 To 41
  653.         Read CVA
  654.         Rain(3,C)=CVA
  655.     Next C
  656.     View 
  657.     RDATA:
  658.     Data $0,$0,$406,$507,$608,$709,$80A,$90B
  659.     Data $A0C,$B0D,$B0D,$A0C,$90B,$80A,$709,$608
  660.     Data $507,$406,$0,$0,$0,$0,$0,$5
  661.     Data $6,$7,$8,$109,$20A,$30B,$40C,$50D
  662.     Data $50D,$40C,$30B,$20A,$109,$8,$7,$6
  663.     Data $5,$0,$0,$0,$0,$0,$0,$0
  664. End Proc
  665. Procedure VU_FOREGROUND_RBOW
  666.     ' Used to display rainbow effect in foreground of main demo to give  
  667.     ' illusion of depth. Appears through colour 0. Created using Spages  
  668.     ' Rainbow Warrior Prog.  
  669.     Set Rainbow 2,0,58,"","",""
  670.     Rainbow 2,0,262,58
  671.     Colour Back 0
  672.     Restore RDATA
  673.     For C=0 To 57
  674.         Read CVA
  675.         Rain(2,C)=CVA
  676.     Next C
  677.     View 
  678.     RDATA:
  679.     Data $9,$A,$A,$A,$A,$B,$B,$B
  680.     Data $B,$11C,$11C,$11C,$11C,$22D,$22D,$22D
  681.     Data $22D,$33E,$33E,$33E,$44F,$44F,$44F,$44F
  682.     Data $55F,$55F,$55F,$55F,$66F,$66F,$66F,$66F
  683.     Data $77F,$77F,$77F,$77F,$88F,$88F,$88F,$88F
  684.     Data $99F,$99F,$99F,$99F,$AAF,$AAF,$AAF,$AAF
  685.     Data $BBF,$BBF,$BBF,$BBF,$CCF,$CCF,$CCF,$CCF
  686.     Data $DDF,$DDF
  687. End Proc