home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 2 / ACE CD 2.iso / FILES / UTILS / AMOSPRO4.DMS / in.adf / Tutorials / Appear.AMOS / Appear.amosSourceCode
Encoding:
AMOS Source Code  |  1992-09-28  |  3.3 KB  |  109 lines

  1. '*************************** 
  2. '*    AMOS Professional    * 
  3. '*                         * 
  4. '*         APPEAR          * 
  5. '*                         * 
  6. '* (c) Europress Software  * 
  7. '*                         * 
  8. '*     Ronnie Simpson      * 
  9. '*************************** 
  10. '
  11. '------------------------------------------- 
  12. 'SETTING UP
  13. '------------------------------------------- 
  14. '        +----->The command (Produces a fancy fade between two screens)  
  15. '        |   +----->The source screen number     
  16. '        |   |    +----->The destination screen number     
  17. '        |   |    |   +----->The effect to be used 
  18. '        |   |    |   |      +----->Number of pixels to be affected (only use
  19. '        |   |    |   |      |      if you wish to fade part of the screen)
  20. '        ^   ^    ^   ^      ^ 
  21. '     Appear 1 To 0,1099 [,64000]  
  22. '
  23. '------------------------------------------- 
  24. 'NOTES 
  25. '------------------------------------------- 
  26. 'Screens are faded in strict order from top to bottom. 
  27. 'The default is to fade the full screen size.
  28. '
  29. 'Works best with effect numbers that do not divide evenly into the total   
  30. 'number of pixels for the screen size being used.
  31. '
  32. 'Eg. Screen size in use 320 by 200 pixels (the default screen) 
  33. '    Multiply together to give total number of pixels 320*200=64000
  34. '    Use any effect number that does not divide evenly into 64000
  35. '    
  36. 'Appearances of fades vary depending on screen modes being used. 
  37. 'Only the destination screen is affected.  
  38. '------------------------------------------- 
  39. 'WORKING EXAMPLE 
  40. '------------------------------------------- 
  41. 'The following program opens 2 screens, draws a random pattern to both and 
  42. 'uses the Appear command to continually fade between the two screens.  
  43. 'A new random pattern is drawn to the 'hidden screen' after each Appear  
  44. 'is complete and the next effect number is read from the data. 
  45. '
  46. 'PRESS AND HOLD ANY MOUSE KEY TO STOP PROGRAM
  47. '------------------------------------------- 
  48. '
  49. '
  50. Rem *** Open and tidy up 2 screens 
  51. '
  52. Screen Open 2,320,200,16,Lowres : Curs Off : Flash Off : Paper 0 : Cls 0
  53. Screen Open 1,320,200,16,Lowres : Curs Off : Flash Off : Paper 0 : Cls 0
  54. Hide 
  55. Load "AMOSPro_Tutorial:Objects/bobs.abk"
  56. Get Sprite Palette 
  57. '
  58. '
  59. Rem *** Draw an initial random pattern to screen 1 
  60. '
  61. Set Pattern Rnd(20) : Set Paint 1 : Ink Rnd(15),Rnd(15),4
  62. Bar 14,20 To 306,180 : Ink 14 : Box 15,21 To 305,179 : Pen 15
  63. '
  64. '
  65. Rem *** Start main loop  
  66. '
  67. Repeat 
  68.    '
  69.    '
  70.    Rem *** read the next effect number to be used 
  71.    '
  72.    Read EFFECT : If EFFECT=99 Then Restore 
  73.    '
  74.    '
  75.    Rem *** Make screen 1 the current screen and show user what is happening 
  76.    '
  77.    Screen 1
  78.    Locate 0,1 : Centre "SCREEN 1"
  79.    Locate 0,23 : Centre "        "
  80.    Wait 50
  81.    '
  82.    '
  83.    Rem *** Make screen 2 the current (but hidden) screen and draw new pattern 
  84.    '
  85.    Screen 2
  86.    Set Pattern Rnd(20) : Set Paint 1 : Ink Rnd(15),Rnd(15),4
  87.    Bar 14,20 To 306,180
  88.    Ink 14 : Box 15,21 To 305,179
  89.    Locate 0,23 : Centre "SCREEN 2"
  90.    Clip 16,22 To 305,179 : R=Rnd(3)+1
  91.    For Z=1 To 5 : Paste Bob Rnd(210)+13,Rnd(90)+23,R : Next 
  92.    '
  93.    '
  94.    Rem *** Now fade between the two screens 
  95.    '
  96.    Appear 2 To 1,EFFECT
  97.    For DELAY=1 To 50
  98.       If Mouse Key Then Edit 
  99.       Wait Vbl 
  100.    Next 
  101.    '
  102.    '
  103.    Rem *** repeat if no mouse key is being pressed
  104.    '
  105. Until Mouse Key
  106. '
  107. '
  108. Edit 
  109. Data 2559,199,3,12799,7,9,11,13,17,19,21,23,27,29,31,33,37,39,41,6399,99