home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / procedures / screen_sine.amos / screen_sine.amosSourceCode
AMOS Source Code  |  1992-09-02  |  2KB  |  107 lines

  1. ' *******************
  2. ' *** SCREEN SINE ***
  3. ' *******************
  4.  
  5. ' *** This Routine Moves The Screen Around, Like A Wave. 
  6.  
  7. ' *** This Next Command Makes The Screen Sine Work.
  8.  
  9. Degree 
  10.  
  11. ' *** Set-Up Screen. 
  12.  
  13. Screen Open 0,320,200,2,Lowres
  14. Curs Off 
  15. Flash Off 
  16. Palette $0,$FF0
  17. Pen 1
  18. Paper 0
  19. Cls 0
  20.  
  21. ' *** Print Text.
  22.  
  23. Locate 0,0
  24. Print "TEST!";
  25.  
  26. ' *** Zoom Text. 
  27.  
  28. Zoom 0,0,0,40,8 To 0,50,50,269,149
  29.  
  30. ' *** Erase Small Text.
  31.  
  32. Cline 
  33.  
  34. ' *** Open Screen To Scroll On.
  35.  
  36. Screen Open 1,Screen Width,Screen Height,Screen Colour,Lowres
  37. Curs Off 
  38. Flash Off 
  39. Get Palette 0
  40. Cls 0
  41.  
  42. ' *** Set Scroll Variables.  
  43.  
  44. SX=1
  45. SY=1
  46.  
  47. ' *** Horizontal Sine. 
  48.  
  49. Repeat 
  50.    
  51.    _SINE_X[SX,30,-3,5]
  52.    Add SX,10,1 To 360
  53.    
  54. Until Inkey$<>"" or Mouse Key
  55.  
  56. ' *** Wait.
  57.  
  58. Wait 5
  59.  
  60. ' *** Vertical Sine. 
  61.  
  62. Repeat 
  63.    
  64.    _SINE_Y[SY,30,-3,5]
  65.    Add SY,10,1 To 360
  66.    
  67. Until Inkey$<>"" or Mouse Key
  68.  
  69. ' *** Close Screens & Quit.  
  70.  
  71. Screen Close 0
  72. Screen Close 1
  73.  
  74. Direct 
  75.  
  76. ' *** BASE  - This Is What Position The Sine Wave Is In (0-360). 
  77. '     SIZE  - This Is The Actual Size Of The Wave (1-???). 
  78. '     SSTEP - This Is The Speed Of The Wave (1-???). 
  79. '     BLOCK - This Is How Detailed The Wave Is (1-30).   
  80.  
  81. Procedure _SINE_X[BASE,SIZE,SSTEP,BLOCK]
  82.    
  83.    Screen 0
  84.    X=Screen Width
  85.    Y=Screen Height
  86.    SA=BASE
  87.    
  88.    For F=0 To X Step BLOCK
  89.       Screen Copy 0,F,0,F+BLOCK,Y To 1,F,Sin(SA)*SIZE
  90.       Add SA,SSTEP,1 To 360
  91.    Next F
  92.    
  93. End Proc
  94.  
  95. Procedure _SINE_Y[BASE,SIZE,SSTEP,BLOCK]
  96.    
  97.    Screen 0
  98.    X=Screen Width
  99.    Y=Screen Height
  100.    SA=BASE
  101.    
  102.    For F=0 To Y Step BLOCK
  103.       Screen Copy 0,0,F,X,F+BLOCK To 1,Sin(SA)*SIZE,F
  104.       Add SA,SSTEP,1 To 360
  105.    Next F
  106.    
  107. End Proc