home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / subroutines / reflectingscroll.amos / reflectingscroll.amosSourceCode
AMOS Source Code  |  1991-06-11  |  7KB  |  199 lines

  1. Rem Scroller Demo
  2. Rem by JAG of FANATIX
  3. Rem
  4. Proc DEMO
  5. Procedure DEMO
  6. Screen Open 0,320,256,2,Lowres : Cls 0 : Hide On 
  7. Close Workbench : Close Editor : Led Off : Break Off 
  8. Load "refspr.abk",1
  9. Load "refmus.abk",3
  10. Load "reffont.abk",6
  11. Music 1
  12. Dim L$(34) : Dim X(34) : Dim Y(34) : Gosub VARLOAD
  13. SC=16 : CH=1 : SCAR=7 : LETTER$="abcdefghijklmnopqrstuvwxyz?.:,=-_ "
  14. TS$="Let R1=0; Restart:  Let R0=1; Pause; Loop:  Let R0=R0+2; Let X=R0; Let R1=R1+1; If R1=16 then Jump G; H:  If X>384 then Jump Restart; Pause; Jump Loop; G:  Let R1=0; Jump H;"
  15. BS$="Let R1=0; Restart:  Let R0=1; Pause; Loop:  Let R0=R0+2; Let X=R0; Let R1=R1+1; If R1=16 then Jump G; H:  If X>384 then Jump Restart; Pause; Jump Loop; G:  Let R1=0; Jump H;"
  16. TB$="Ustart:  Let Y=2; Loop:  Let Y=Y+1; If Y=42 then Jump Dstart; Pause; Jump Loop; Dstart:  Let Y=Y-1; If Y=2 then Jump Loop; Pause; Jump Dstart;"
  17. BB$="Ustart:  Let Y=42; Loop:  Let Y=Y-1; If Y=2 then Jump Dstart; Pause; Jump Loop; Dstart:  Let Y=Y+1; If Y=42 then Jump Loop; Pause; Jump Dstart;"
  18. TU$="Let Y=2; Loop:  Let Y=Y+1; If Y=42 then Jump S; Pause; Jump Loop; S:  Jump S;"
  19. BU$="Let Y=42; Loop:  Let Y=Y-1; If Y=2 then Jump S; Pause; Jump Loop; S:  Jump S;"
  20. BD$="Let Y=2; Loop:  Let Y=Y+1; If Y=42 then Jump S; Pause; Jump Loop; S:  Jump S;"
  21. TD$="Let Y=42; Loop:  Let Y=Y-1; If Y=2 then Jump S; Pause; Jump Loop; S:  Jump S;"
  22. TE$="Loop:  Let Y=Y+1; If Y=42 then Jump S; Pause; Jump Loop; S:  Jump S;"
  23. BE$="Loop:  Let Y=Y-1; If Y=2 then Jump S; Pause; Jump Loop; S:  Jump S;"
  24. RA$="Restart:  Let X=0; Pause; Loop:  Let X=X+1; If X>63 then Jump Restart; Pause; Jump Loop;"
  25.    T$="    <   and yet>another fanatix release hits you hard in the brain...<                    "
  26. T$=T$+">  the credits for this are:                <    jag ->coding<"
  27. T$=T$+"         jag ->gfx  <         music>by zero defects......<               "
  28. T$=T$+">you know, this is a really funky scroller to type<in,>(a hardware one by the way), especially with"
  29. T$=T$+" these stupid effects.<      # thats much more wild.  by the way, this font is taken from the"
  30. T$=T$+" @blitterchips fonts disk.  this one is great but<i had#to alter it a bit to look best"
  31. T$=T$+"........@    <              >where is chaos????  he usually manages to disturb me when im trying"
  32. T$=T$+" to write a scroller.<               >    #once upon a time there"
  33. T$=T$+" was paf the dog..  he went into the road where there was a fast truck.....@ paf the dog.......<"
  34. T$=T$+"             >very strange joke that, it was written by a french person, as you may expect....<"
  35. T$=T$+"      this is>the last demo i have to code for the megademo,<and i am#just waiting for chaos to"
  36. T$=T$+" finish the intro gfx, but as he is so lazy this will probably never happen. @at the time of writing,"
  37. T$=T$+" the only thing in this demo is the<scroll...#boring        @      <      surely>i must put something else"
  38. T$=T$+" in to make it<more fun#to watch......@     <           #what do you think of this effect. @i find it"
  39. T$=T$+" bloody annoying....<              >ha, i have just put in the logo you see, and programmed in a star effect.<  "
  40. T$=T$+"  #i have a nice little routine that makes these star effects.@ but i wont let anyone copy it....<          "
  41. T$=T$+">syntex<will>probably guess how it was done.< nice#stuff guyz.  some quick hellos to:@          <"
  42. T$=T$+"steve and>trisha from blitterchips p.d. ,<all demo>groups, all<amos demo#groups, and parsley the lion.@   <"
  43. T$=T$+"      #bye for now.  see you in the other cool demos.....................................                @"
  44. Screen Open 0,800,80,16,Lowres
  45. Flash Off : Hide On : Curs Off : Cls 0
  46. Screen Display 0,110,230,360,40
  47. Screen Open 1,800,84,16,Lowres
  48. Flash Off : Hide On : Curs Off : Cls 0
  49. Screen Display 1,110,262,360,40
  50. Unpack 6 To 2
  51. Screen To Back 2 : Screen Hide 2 : Screen 0 : Get Palette 2
  52. Screen Open 3,320,256,32,Lowres : Flash Off : Curs Off : Cls 0
  53. Screen Display 3,128,40,,230
  54. Screen Hide 3 : Gosub DRSTARS : Screen Show 3 : Screen To Back 3
  55. Set Rainbow 1,1,64,"(2,1,15)(2,-1,15)","","(2,1,15)(2,-1,15)"
  56. Rainbow 1,0,40,100
  57. Screen 1 : Palette $4,$CDF,$BCE,$ABD,$9AC,$89B,$78A,$679,$568,$457,$346,$235,$124,$13,$3,$2
  58. Screen 0
  59. Channel 0 To Screen Offset 0
  60. Channel 1 To Screen Offset 0
  61. Channel 2 To Screen Offset 1
  62. Channel 3 To Screen Offset 1
  63. Channel 4 To Rainbow 1
  64. Screen Offset 0,,2
  65. Screen Offset 1,,42
  66. Amal 0,TS$
  67. Amal 1,TU$
  68. Amal 2,BS$
  69. Amal 3,BU$
  70. Amal 4,RA$
  71. Amal On 
  72. Do 
  73. SC=Amreg(0,0)
  74. N=Amreg(0,1)
  75. If N=15 Then Gosub PCHAR
  76. If Mouse Key=1 Then Goto DIE
  77. Wait Vbl 
  78. Loop 
  79. PCHAR:
  80. Inc CH : If CH=Len(T$) Then CH=1
  81. S$=Mid$(T$,CH,1)
  82. P=Instr(LETTER$,S$)
  83. If P=0 Then Gosub FX
  84. Screen Copy 2,X(P),Y(P),(X(P))+31,(Y(P))+31 To 0,SC-32,40
  85. Screen Copy 2,X(P),Y(P),(X(P))+31,(Y(P))+31 To 0,SC+352,40
  86. Screen Copy 2,X(P),Y(P)+128,(X(P))+31,(Y(P))+31+128 To 1,SC-32,1
  87. Screen Copy 2,X(P),Y(P)+128,(X(P))+31,(Y(P))+31+128 To 1,SC+352,1
  88. Return 
  89. FX:
  90. P=34
  91. If S$="<" Then Goto DWN
  92. If S$=">" Then Goto UP
  93. If S$="@" Then Goto STP
  94. If S$="#" Then Goto BOUNCE
  95. Return 
  96. DWN:
  97. Amal Freeze 1 : Amal Freeze 3 : Amal 1,TD$ : Amal 3,BD$ : Wait Vbl : Amal On 1 : Amal On 3
  98. Return 
  99. UP:
  100. Amal Freeze 1 : Amal Freeze 3 : Amal 1,TU$ : Amal 3,BU$ : Wait Vbl : Amal On 1 : Amal On 3
  101. Return 
  102. STP:
  103. Amal 1,TE$ : Amal 3,BE$ : Wait Vbl : Amal On 
  104. Return 
  105. BOUNCE:
  106. Amal 1,TB$ : Amal 3,BB$ : Amal On 
  107. Return 
  108. Rem ************************************************************** 
  109. DRSTARS:
  110. Degree 
  111. CO=4
  112. LE=1
  113. For F=1 To 360 Step 4
  114. Ink CO
  115. Plot(Sin(F)*LE)+160,(Sin(F+90)*LE)+128
  116. Plot(Sin(F+45)*LE)+160,(Sin(F+135)*LE)+128
  117. Plot(Sin(F+90)*LE)+160,(Sin(F+180)*LE)+128
  118. Plot(Sin(F+135)*LE)+160,(Sin(F+225)*LE)+128
  119. Plot(Sin(F+180)*LE)+160,(Sin(F+270)*LE)+128
  120. Plot(Sin(F+225)*LE)+160,(Sin(F+315)*LE)+128
  121. Plot(Sin(F+270)*LE)+160,(Sin(F)*LE)+128
  122. Plot(Sin(F+315)*LE)+160,(Sin(F+45)*LE)+128
  123. Inc CO : If CO=32 Then CO=4
  124. LE=LE+2
  125. Next F
  126. Palette 0,$FFF,$F0F,$F0F,$FFF,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  127. Shift Up 1,4,31,1
  128. Paste Bob 0,10,1
  129. Return 
  130. VARLOAD:
  131. For F=1 To 34
  132. Read A$ : Read A : Read B
  133. L$(F)=A$ : X(F)=A : Y(F)=B
  134. Next F
  135. Return 
  136. Rem ************************************************************** 
  137. SCDATA:
  138. Rem Data for Steelfont 
  139. Rem
  140. Data "a",0,0
  141. Data "b",32,0
  142. Data "c",64,0
  143. Data "d",96,0
  144. Data "e",128,0
  145. Data "f",160,0
  146. Data "g",192,0
  147. Data "h",224,0
  148. Data "i",256,0
  149. Data "j",288,0
  150. Data "k",0,32
  151. Data "l",32,32
  152. Data "m",64,32
  153. Data "n",96,32
  154. Data "o",128,32
  155. Data "p",160,32
  156. Data "q",192,32
  157. Data "r",224,32
  158. Data "s",256,32
  159. Data "t",288,32
  160. Data "u",0,64
  161. Data "v",32,64
  162. Data "w",64,64
  163. Data "x",96,64
  164. Data "y",128,64
  165. Data "z",160,64
  166. Data "?",192,64
  167. Data ".",224,64
  168. Data ":",256,64
  169. Data ",",288,64
  170. Data "=",0,96
  171. Data "-",32,96
  172. Data "_",64,96
  173. Data " ",96,96
  174. Data " ",128,96
  175. DIE:
  176. Gosub DWN
  177. Screen 0
  178. For F=0 To 3000 : Next F
  179. Fade 3 : Wait 45
  180. Screen 1 : Fade 3 : Wait 45
  181. Screen Close 2
  182. Screen 3 : Colour 1,$0
  183. For F=100 To 1 Step -1
  184. Rainbow 1,,40,F
  185. Wait Vbl 
  186. Next F
  187. Shift Off 
  188. Fade 5
  189. Amal Off 
  190. For F=63 To 0 Step -1
  191. For T=0 To 1000 : Next T : Mvolume F : Next F
  192. Screen Close 3
  193. Screen Close 1
  194. Screen Close 0
  195. Music Off 
  196. Mvolume 63
  197. Set Rainbow 1,0,16,"","",""
  198. Run "Outro.AMOS"
  199. End Proc